Packagecom.noteflight.standingwave2.filters
Classpublic class AbstractFilter
InheritanceAbstractFilter Inheritance Object
Implements IAudioFilter
Subclasses BiquadFilter, EchoFilter, EnvelopeFilter, GainFilter

An abstract implementation of the IAudioFilter interface that can be overridden to supply the specific transformation for a specific filter subclass.



Public Properties
 PropertyDefined By
  descriptor : AudioDescriptor
[read-only] The AudioDescriptor describing the audio characteristics of this source.
AbstractFilter
  frameCount : Number
[read-only] The number of sample frames in this source.
AbstractFilter
  position : Number
[read-only] The position of the audio cursor in this source, as a frame index.
AbstractFilter
  source : IAudioSource
The underlying audio source for this filter.
AbstractFilter
Protected Properties
 PropertyDefined By
  _source : IAudioSource
The underlying source that acts as input to this filter.
AbstractFilter
Public Methods
 MethodDefined By
  
Create a new filter based on some underlying source.
AbstractFilter
  
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.
AbstractFilter
  
getSample(numFrames:Number):Sample
Retrieve a number of sample frames from this source as a Sample object, starting from the audio cursor position.
AbstractFilter
  
Resets the audio cursor to the beginning of the source, and causes any cursor-dependent state in the source to be initialized.
AbstractFilter
Protected Methods
 MethodDefined By
  
transformChannel(data:Vector.<Number>, channel:Number, start:Number, numFrames:Number):void
Transform the data for a channel by modifying it in place; called by the default implementation of getSample().
AbstractFilter
Property Detail
_sourceproperty
protected var _source:IAudioSource

The underlying source that acts as input to this filter.

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
sourceproperty 
source:IAudioSource

The underlying audio source for this filter.


Implementation
    public function get source():IAudioSource
    public function set source(value:IAudioSource):void
Constructor Detail
AbstractFilter()Constructor
public function AbstractFilter(source:IAudioSource = null)

Create a new filter based on some underlying source.

Parameters
source:IAudioSource (default = null) — the source that this filter transforms to produce its output.
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.

transformChannel()method 
protected function transformChannel(data:Vector.<Number>, channel:Number, start:Number, numFrames:Number):void

Transform the data for a channel by modifying it in place; called by the default implementation of getSample(). Overridden by subclasses.

Parameters

data:Vector.<Number> — a Vector of channel data
 
channel:Number — the index of the channel being transformed
 
start:Number — the starting sample index of the transformation
 
numFrames:Number — the number of samples to be transformed