Package | de.popforge.audio.output |
Class | public class AudioBuffer |
Property | Defined by | ||
---|---|---|---|
isInit : Boolean [read-only]
Returns true, if the AudioBuffer is inited
| AudioBuffer | ||
leftPeak : Number [read-only]
Returns current peak(left)
| AudioBuffer | ||
millisEachBuffer : Number [read-only]
Returns number of milliseconds of each buffer
| AudioBuffer | ||
numSamples : uint [read-only]
Returns number of samples
| AudioBuffer | ||
onComplete : Function
Stores a delegate function called, when the AudioBuffer has complete its cycle.
| AudioBuffer | ||
onInit : Function
Stores a delegate function called, when the AudioBuffer is inited.
| AudioBuffer | ||
onStart : Function
Stores a delegate function called, when the AudioBuffer is started.
| AudioBuffer | ||
onStop : Function
Stores a delegate function called, when the AudioBuffer is stopped.
| AudioBuffer | ||
rightPeak : Number [read-only]
Returns current peak(right)
| AudioBuffer |
Method | Defined by | ||
---|---|---|---|
AudioBuffer(multiple:uint, channels:uint, bits:uint, rate:uint)
Creates an AudioBuffer instance.
| AudioBuffer | ||
getBits():uint
Returns number of bits.
| AudioBuffer | ||
getChannels():uint
Returns number of channels.
| AudioBuffer | ||
getMultiple():uint
Returns length of the buffer (sampleNum / UNIT_SAMPLES_NUM)
| AudioBuffer | ||
getRate():uint
Returns samplingRate in Hz
| AudioBuffer | ||
getSamples():Array
Returns samples for overriding with new amplitudes
| AudioBuffer | ||
isPlaying():Boolean
Returns true, if the AudioBuffer is playing
| AudioBuffer | ||
setBits(bits:uint):void
Sets the number of bits.
| AudioBuffer | ||
setChannels(channels:uint):void
Sets the number of channels.
| AudioBuffer | ||
setMultiple(multiple:uint):void
Sets the length of the buffer.
| AudioBuffer | ||
setRate(rate:uint):void
Sets the samplingRate.
| AudioBuffer | ||
start():Boolean
Starts the AudioBuffer playback
| AudioBuffer | ||
stop():Boolean
Stops the AudioBuffer playback
| AudioBuffer | ||
update():ByteArray
Updates the AudioBuffer samples for the next playback cycle
Must be called after the new samples are computed
| AudioBuffer |
Constant | Defined by | ||
---|---|---|---|
UNIT_SAMPLES_NUM : uint = 2048 [static]
The internal minimal sound buffer length in samples(PC)
| AudioBuffer |
isInit | property |
isInit:Boolean
[read-only]Returns true, if the AudioBuffer is inited
Implementation public function get isInit():Boolean
leftPeak | property |
leftPeak:Number
[read-only]Returns current peak(left)
Implementation public function get leftPeak():Number
millisEachBuffer | property |
millisEachBuffer:Number
[read-only]Returns number of milliseconds of each buffer
Implementation public function get millisEachBuffer():Number
numSamples | property |
numSamples:uint
[read-only]Returns number of samples
Implementation public function get numSamples():uint
onComplete | property |
public var onComplete:Function
Stores a delegate function called, when the AudioBuffer has complete its cycle.
onInit | property |
public var onInit:Function
Stores a delegate function called, when the AudioBuffer is inited.
onStart | property |
public var onStart:Function
Stores a delegate function called, when the AudioBuffer is started.
onStop | property |
public var onStop:Function
Stores a delegate function called, when the AudioBuffer is stopped.
rightPeak | property |
rightPeak:Number
[read-only]Returns current peak(right)
Implementation public function get rightPeak():Number
AudioBuffer | () | constructor |
public function AudioBuffer(multiple:uint, channels:uint, bits:uint, rate:uint)
Creates an AudioBuffer instance.
Parametersmultiple:uint — Defines the buffer length (4times recommended)
|
|
channels:uint — Mono(1) or Stereo(2)
|
|
bits:uint — 8bit(8) or 16bit(16)
|
|
rate:uint — SamplingRate 5512Hz, 11025Hz, 22050Hz, 44100Hz
|
getBits | () | method |
public function getBits():uint
Returns number of bits.
Returnsuint |
getChannels | () | method |
public function getChannels():uint
Returns number of channels.
Returnsuint |
getMultiple | () | method |
public function getMultiple():uint
Returns length of the buffer (sampleNum / UNIT_SAMPLES_NUM)
Returnsuint |
getRate | () | method |
public function getRate():uint
Returns samplingRate in Hz
Returnsuint |
getSamples | () | method |
public function getSamples():Array
Returns samples for overriding with new amplitudes
ReturnsArray |
isPlaying | () | method |
public function isPlaying():Boolean
Returns true, if the AudioBuffer is playing
ReturnsBoolean |
setBits | () | method |
public function setBits(bits:uint):void
Sets the number of bits. Stops AudioBuffer playback for new a init phase
Parametersbits:uint |
setChannels | () | method |
public function setChannels(channels:uint):void
Sets the number of channels. Stops AudioBuffer playback for new a init phase
Parameterschannels:uint |
setMultiple | () | method |
public function setMultiple(multiple:uint):void
Sets the length of the buffer. Stops AudioBuffer playback for new a init phase
Parametersmultiple:uint |
setRate | () | method |
public function setRate(rate:uint):void
Sets the samplingRate. Stops AudioBuffer playback for new a init phase
Parametersrate:uint |
start | () | method |
public function start():Boolean
Starts the AudioBuffer playback
ReturnsBoolean |
stop | () | method |
public function stop():Boolean
Stops the AudioBuffer playback
ReturnsBoolean |
update | () | method |
public function update():ByteArray
Updates the AudioBuffer samples for the next playback cycle Must be called after the new samples are computed
ReturnsByteArray |
UNIT_SAMPLES_NUM | constant |
public static const UNIT_SAMPLES_NUM:uint = 2048
The internal minimal sound buffer length in samples(PC)