Packagecom.sonoport
Classpublic class AudioStretch
InheritanceAudioStretch Inheritance com.sonoport.BaseSound
Implements IAudioStretch

Performs pitch-shifting and time-shifting of an mp3 file.



Public Properties
 PropertyDefined By
  audioFile : Object
The source audio file.
AudioStretch
  duration : Number
[read-only] Duration of the loaded sound (seconds)
AudioStretch
  mono : Boolean
Assume source signal is mono (i.e.
AudioStretch
  pitchShift : Number
Pitch shift (semitones).
AudioStretch
  position : Number
Current playback position (seconds).
AudioStretch
  speed : Number
Playback speed.
AudioStretch
  useOriginalPhase : Boolean
Use original phases (in effect bypassing the processing)
AudioStretch
  usePeakLock : Boolean
Lock phases around spectral peaks.
AudioStretch
Public Methods
 MethodDefined By
  
AudioStretch
Events
 Event Summary Defined By
  Dispatched when finished loading the file specified by audioFile.AudioStretch
  Dispatched if file specified by audioFile cannot be loaded.AudioStretch
  Dispatched when a sound has finished playing.AudioStretch
Property Detail
audioFileproperty
audioFile:Object

The source audio file. The audio file must be a 16-bit 44.1 kHz stereo mp3.

It can be embedded within your swf/swc, stored as external files, or specified as a FileReference. Typical syntax is as follows.

Embedded mp3 files

		 [Embed(source="ImpossiblyFastSolo.mp3")]
		 private var MUSIC:Class;
		 
		 var extender:AudioStretch = new AudioStretch;
		 extender.audioFile = MUSIC;
		 

mp3 in separate file

		 extender.audioFile = "OceanSurf.mp3";
		 


Implementation
    public function get audioFile():Object
    public function set audioFile(value:Object):void
durationproperty 
duration:Number  [read-only]

Duration of the loaded sound (seconds)


Implementation
    public function get duration():Number
monoproperty 
mono:Boolean

Assume source signal is mono (i.e. same signal in left and right channels).


Implementation
    public function get mono():Boolean
    public function set mono(value:Boolean):void
pitchShiftproperty 
pitchShift:Number

Pitch shift (semitones).


Implementation
    public function get pitchShift():Number
    public function set pitchShift(value:Number):void
positionproperty 
position:Number

Current playback position (seconds).


Implementation
    public function get position():Number
    public function set position(value:Number):void
speedproperty 
speed:Number

Playback speed. 1.0 is normal speed. Can be zero, or even negative!


Implementation
    public function get speed():Number
    public function set speed(value:Number):void
useOriginalPhaseproperty 
useOriginalPhase:Boolean

Use original phases (in effect bypassing the processing)


Implementation
    public function get useOriginalPhase():Boolean
    public function set useOriginalPhase(value:Boolean):void
usePeakLockproperty 
usePeakLock:Boolean

Lock phases around spectral peaks.


Implementation
    public function get usePeakLock():Boolean
    public function set usePeakLock(value:Boolean):void
Constructor Detail
AudioStretch()Constructor
public function AudioStretch()



Event Detail
complete Event
Event Object Type: flash.events.Event
Event.type property = flash.events.Event.COMPLETE

Dispatched when finished loading the file specified by audioFile.

error Event  
Event Object Type: flash.events.ErrorEvent
ErrorEvent.type property = flash.events.ErrorEvent.ERROR

Dispatched if file specified by audioFile cannot be loaded.

soundComplete Event  
Event Object Type: flash.events.Event

Dispatched when a sound has finished playing. The Event.SOUND_COMPLETE constant defines the value of the type property of a soundComplete event object.