Packagecom.sonoport
Classpublic class Extender
InheritanceExtender Inheritance com.sonoport.BaseSound
Implements IExtender

Takes an ambient or atmospheric mp3 sound and extends it indefinitely without obvious repetition. You can also dramatically alter the sound by shifting its pitch or by applying a filter to it. Works best with "ambient" sounds, for example wind, surf, crowd or traffic noise, etc.

In a typical case, you'd create an Extender object, load an external mp3 file, and call play().

	 var extender:Extender = new Extender;	
	 extender.audioFile = "OceanSurf.mp3";
	 extender.play();
	 
	 



Public Properties
 PropertyDefined By
  audioFile : Object
The ambient sound recording to use as raw material.
Extender
  eventLen : Number
Event period (s).
Extender
  filterFreq : Number
Filter frequency (Hz).
Extender
  filterQ : Number
Filter Q (i.e.
Extender
  filterType : int
Filter type.
Extender
  pitchShift : Number
Pitch Shift (octaves).
Extender
  reverse : Boolean
Reverse.
Extender
  xfadeDur : Number
Cross-fade duration (fraction of max possible for given Event length).
Extender
Public Methods
 MethodDefined By
  
Constructor
Extender
Events
 Event Summary Defined By
  Dispatched when Extender has finished loading the file specified by audioFile.Extender
  Dispatched if Extender is unable to load the file specified by audioFile.Extender
Public Constants
 ConstantDefined By
  FILTER_TYPE_BANDPASS : uint = 3
[static] Use band-pass filter.
Extender
  FILTER_TYPE_HIGHPASS : uint = 2
[static] Use high-pass filter.
Extender
  FILTER_TYPE_LOWPASS : uint = 1
[static] Use low-pass filter.
Extender
  FILTER_TYPE_NONE : uint = 0
[static] No filtering.
Extender
Property Detail
audioFileproperty
audioFile:Object

The ambient sound recording to use as raw material. The audio file must be 16-bit 44.1 kHz stereo, wav or mp3.

The recording can be wav or mp3 (44.1 kHz, 16-bit, stereo only), and 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="OceanSurf.mp3")]
		 private var OCEANSURF:Class;
		 
		 var extender:Extender = new Extender;
		 extender.audioFile = OCEANSURF;
		 

Embedded wav file

		 [Embed(source="OceanSurf.wav", mimeType="application/octet-stream")]
 		 private var OCEANSURF:Class;
		 extender.audioFile = OCEANSURF;
		 

mp3 in separate file

		 extender.setParam( Extender.AUDIO_FILE, "OceanSurf.mp3" );
		 

wav in separate file

		 extender.audioFile = "OceanSurf.wav";
		 


Implementation
    public function get audioFile():Object
    public function set audioFile(value:Object):void
eventLenproperty 
eventLen:Number

Event period (s). Default is 2. Range is [0.1, 10].


Implementation
    public function get eventLen():Number
    public function set eventLen(value:Number):void
filterFreqproperty 
filterFreq:Number

Filter frequency (Hz). Default is 1000. Range is [10, 11025].


Implementation
    public function get filterFreq():Number
    public function set filterFreq(value:Number):void
filterQproperty 
filterQ:Number

Filter Q (i.e. selectivity). Default is 1. Range is [0.01, 10].


Implementation
    public function get filterQ():Number
    public function set filterQ(value:Number):void
filterTypeproperty 
filterType:int

Filter type. 0=none, 1=lopass, 2=highpass, 3=bandpass. Default is 0. Range is [0, 3].


Implementation
    public function get filterType():int
    public function set filterType(value:int):void
pitchShiftproperty 
pitchShift:Number

Pitch Shift (octaves). Default is 0. Range is [-2, 2].


Implementation
    public function get pitchShift():Number
    public function set pitchShift(value:Number):void
reverseproperty 
reverse:Boolean

Reverse. Default is false.


Implementation
    public function get reverse():Boolean
    public function set reverse(value:Boolean):void
xfadeDurproperty 
xfadeDur:Number

Cross-fade duration (fraction of max possible for given Event length). Default is 0.5. Range is [0, 1].


Implementation
    public function get xfadeDur():Number
    public function set xfadeDur(value:Number):void
Constructor Detail
Extender()Constructor
public function Extender()

Constructor

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

Dispatched when Extender has finished loading the file specified by audioFile.

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

Dispatched if Extender is unable to load the file specified by audioFile.

Constant Detail
FILTER_TYPE_BANDPASSConstant
public static const FILTER_TYPE_BANDPASS:uint = 3

Use band-pass filter. For use when setting filterType parameter.

FILTER_TYPE_HIGHPASSConstant 
public static const FILTER_TYPE_HIGHPASS:uint = 2

Use high-pass filter. For use when setting filterType parameter.

FILTER_TYPE_LOWPASSConstant 
public static const FILTER_TYPE_LOWPASS:uint = 1

Use low-pass filter. For use when setting filterType parameter.

FILTER_TYPE_NONEConstant 
public static const FILTER_TYPE_NONE:uint = 0

No filtering. For use when setting filterType property.