Static methods
staticfromSamplesBuffer(buffer:Float32Array, samples:Int, channels:Int, sampleRate:Float, interleaved:Bool):Sound
Create a new sound from the given samples buffer
Parameters:
buffer | Float32Array containing the raw PCM samples |
---|---|
samples | Number of sample frames (samples per channel) |
channels | Number of audio channels (1 = mono, 2 = stereo, etc.) |
sampleRate | Sample rate in Hz (e.g., 44100) |
interleaved | Whether the PCM data is interleaved (LRLRLR...) or planar (LLL...RRR...) |
Constructor
Variables
Methods
play(position:Float = 0, loop:Bool = false, ?volume:Float, ?pan:Float, ?pitch:Float, ?bus:Int):SoundPlayer
Play the sound at requested position. If volume/pan/pitch are not provided, sound instance properties will be used instead.
Parameters:
position | Start position in seconds |
---|---|
loop | Whether to loop the sound |
volume | Volume (0-1) |
pan | Pan (-1 to 1) |
pitch | Pitch multiplier |
bus | Bus to play on (defaults to sound's bus property) |