Packagecom.noteflight.standingwave2.filters
Classpublic class ResamplingFilter
InheritanceResamplingFilter Inheritance Object
Implements IAudioSource, IRandomAccessSource

This filter implementation resamples an input source by interpolating its samples using a sampling frequency that is some factor higher or lower than its actual sample rate. The result is a signal whose speed and pitch are both shifted relative to the original.



Public Properties
 PropertyDefined By
  descriptor : AudioDescriptor
[read-only] Get the AudioDescriptor for this Sample.
ResamplingFilter
  factor : Number
The factor by which the source's frequency is to be resampled.
ResamplingFilter
  frameCount : Number
[read-only] Get the number of sample frames in this AudioSource.
ResamplingFilter
  position : Number
[read-only]
ResamplingFilter
  source : IAudioSource
The underlying audio source for this filter.
ResamplingFilter
Public Methods
 MethodDefined By
  
ResamplingFilter(source:IAudioSource = null, factor:Number = 1)
Create a new ResamplingFilter to adjust the frequency of its input.
ResamplingFilter
  
ResamplingFilter
  
getSample(numFrames:Number):Sample
ResamplingFilter
  
getSampleRange(fromOffset:Number, toOffset:Number):Sample
Get the concrete audio data from this source that occurs within a given time interval.
ResamplingFilter
  
ResamplingFilter
Property Detail
descriptorproperty
descriptor:AudioDescriptor  [read-only]

Get the AudioDescriptor for this Sample.


Implementation
    public function get descriptor():AudioDescriptor
factorproperty 
public var factor:Number

The factor by which the source's frequency is to be resampled. Higher factors shift frequency upwards.

frameCountproperty 
frameCount:Number  [read-only]

Get the number of sample frames in this AudioSource.


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


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
ResamplingFilter()Constructor
public function ResamplingFilter(source:IAudioSource = null, factor:Number = 1)

Create a new ResamplingFilter to adjust the frequency of its input.

Parameters
source:IAudioSource (default = null) — the input source for this filter
 
factor:Number (default = 1) — the factor by which the input frequency should be multiplied.
Method Detail
clone()method
public function clone():IAudioSource

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

Parameters

numFrames:Number

Returns
Sample
getSampleRange()method 
public function getSampleRange(fromOffset:Number, toOffset:Number):Sample

Get the concrete audio data from this source that occurs within a given time interval. The interval must lie within the bounds of the length of the Sample.

Parameters

fromOffset:Number — the inclusive start of the interval, in sample frames.
 
toOffset:Number — the exclusive end of the interval (that is, one past the last sample frame in the interval)

Returns
Sample — a Sample representing the data in the interval.
resetPosition()method 
public function resetPosition():void