Packagecom.noteflight.standingwave2.elements
Interfacepublic interface IAudioSource
Implementors AbstractSource, AudioPerformer, ResamplingFilter, Sample

An IAudioSource is the fundamental unit of construction for StandingWave audio machines. It represents a source of audio data with characteristics described by an AudioDescriptor, a and a definite number of sample frames. The position property is a cursor that indicates the frame index of the next portion of data that will be retrieved by calling getSample(). The ability to extract slices of data allows audio processing to take place in small enough chunks that CPU intensive operations do not tie up the Flash Player's event processing.



Public Properties
 PropertyDefined By
  descriptor : AudioDescriptor
[read-only] The AudioDescriptor describing the audio characteristics of this source.
IAudioSource
  frameCount : Number
[read-only] The number of sample frames in this source.
IAudioSource
  position : Number
[read-only] The position of the audio cursor in this source, as a frame index.
IAudioSource
Public Methods
 MethodDefined By
  
Return a copy of this source which is functionally identical to it, but which is not required to preserve the audio cursor position or any other internal state.
IAudioSource
  
getSample(numFrames:Number):Sample
Retrieve a number of sample frames from this source as a Sample object, starting from the audio cursor position.
IAudioSource
  
Resets the audio cursor to the beginning of the source, and causes any cursor-dependent state in the source to be initialized.
IAudioSource
Property Detail
descriptorproperty
descriptor:AudioDescriptor  [read-only]

The AudioDescriptor describing the audio characteristics of this source.


Implementation
    public function get descriptor():AudioDescriptor
frameCountproperty 
frameCount:Number  [read-only]

The number of sample frames in this source. An unbounded source may return Number.MAX_VALUE.


Implementation
    public function get frameCount():Number
positionproperty 
position:Number  [read-only]

The position of the audio cursor in this source, as a frame index.


Implementation
    public function get position():Number
Method Detail
clone()method
public function clone():IAudioSource

Return a copy of this source which is functionally identical to it, but which is not required to preserve the audio cursor position or any other internal state. This function is useful for constructing source/filter graphs that can be used as "prototypes", to be duplicated at will.

Returns
IAudioSource
getSample()method 
public function getSample(numFrames:Number):Sample

Retrieve a number of sample frames from this source as a Sample object, starting from the audio cursor position. It is not legal to request frames beyond the maximum index indicated by the frameCount property.

Parameters

numFrames:Number — an integral number of frames.

Returns
Sample — a Sample object containing the requested sample frames.
resetPosition()method 
public function resetPosition():void

Resets the audio cursor to the beginning of the source, and causes any cursor-dependent state in the source to be initialized.