| Package | org.as3wavsound |
| Class | public class WavSound |
| Inheritance | WavSound Object |
| Property | Defined By | ||
|---|---|---|---|
| bytesLoaded : uint [read-only]
Returns the total bytes of the wavData a WavSound was created with. | WavSound | ||
| bytesTotal : int [read-only]
Returns the total bytes of the wavData a WavSound was created with. | WavSound | ||
| length : Number [read-only]
Returns the total length of the sound in milliseconds. | WavSound | ||
| playbackSettings : AudioSetting [read-only]
_playbackSettings is set when the load() function is called. | WavSound | ||
| samples : AudioSamples [read-only] | WavSound | ||
| Method | Defined By | ||
|---|---|---|---|
WavSound(wavData:ByteArray, audioSettings:AudioSetting = null)
Constructor: loads wavdata using load(). | WavSound | ||
extract(target:ByteArray, length:Number, startPosition:Number = -1):Number
No idea if this works. | WavSound | ||
load(wavData:ByteArray, audioSettings:AudioSetting = null):void
Key function: loads WAVE data and decodes it into playable samples. | WavSound | ||
play(startTime:Number = 0, loops:int = 0, sndTransform:SoundTransform = null):WavSoundChannel
See Adobe's Sound.play(): http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Sound.html#play(). | WavSound | ||
| bytesLoaded | property |
bytesLoaded:uint [read-only] Returns the total bytes of the wavData a WavSound was created with. Note: This function is probably legacy, since we're not extending Adobe's Sound anymore (backwards compatibility was dropped in v0.7.
public function get bytesLoaded():uint| bytesTotal | property |
bytesTotal:int [read-only] Returns the total bytes of the wavData a WavSound was created with. Note: This function is probably legacy, since we're not extending Adobe's Sound anymore (backwards compatibility was dropped in v0.7.
public function get bytesTotal():int| length | property |
length:Number [read-only] Returns the total length of the sound in milliseconds.
public function get length():Number| playbackSettings | property |
playbackSettings:AudioSetting [read-only] _playbackSettings is set when the load() function is called.
public function get playbackSettings():AudioSetting| samples | property |
| WavSound | () | Constructor |
public function WavSound(wavData:ByteArray, audioSettings:AudioSetting = null)Constructor: loads wavdata using load(). loads WAVE data and decodes it into playable samples. Finally calculates the length of the sound in milliseconds.
ParameterswavData:ByteArray — A ByteArray containing uncmopressed wav data.
| |
audioSettings:AudioSetting (default = null) — An optional playback configuration (mono/stereo,
sample rate and bit rate).
|
| extract | () | method |
public function extract(target:ByteArray, length:Number, startPosition:Number = -1):NumberNo idea if this works. Alpha state. Read up on Sound.extract(): http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Sound.html#extract() Apparently, some people have used this succesfully, see comment 1 on Issue 11: http://code.google.com/p/as3wavsound/issues/detail?id=11#c1
Parameters
target:ByteArray | |
length:Number | |
startPosition:Number (default = -1) |
Number |
| load | () | method |
public function load(wavData:ByteArray, audioSettings:AudioSetting = null):voidKey function: loads WAVE data and decodes it into playable samples. Finally calculates the length of the sound in milliseconds.
Parameters
wavData:ByteArray — The byte array that is the embedded .was file (octet-stream).
| |
audioSettings:AudioSetting (default = null) — Optional settings for playback (samplerate will enforced
if it differs from the .wav header data or header is missing).
|
See also
| play | () | method |
public function play(startTime:Number = 0, loops:int = 0, sndTransform:SoundTransform = null):WavSoundChannelSee Adobe's Sound.play(): http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Sound.html#play(). Playback function that performs the following tasks: - calculates the startingPhase, bases on startTime in ms. - initializes loopsLeft variable - adds the playing channel in combination with its originating WavSound to the playingWavSounds
Parameters
startTime:Number (default = 0) — The starting time in milliseconds, applies to each loop (as with regular MP3 Sounds).
| |
loops:int (default = 0) — The number of loops to take in dditionto the default playback (loops == 2 means 3 playthroughs).
| |
sndTransform:SoundTransform (default = null) — An optional soundtransform to apply for playback that controls volume and panning.
|
WavSoundChannel — The SoundChannel used for playing back the sound (and stopping the sound).
|