Struct AudioStreamSample
Stores audio data loaded from WAV files.
struct AudioStreamSample
;
AudioStreamSample stores sound samples loaded from WAV files. To play the stored sound, use an AudioStreamPlayer (for non-positional audio) or AudioStreamPlayer2D/AudioStreamPlayer3D (for positional audio). The sound can be looped.
This class can also be used to store dynamically-generated PCM audio data.
Properties
| Name | Type | Description |
|---|---|---|
data[get, set]
|
PoolArray!(ubyte) | Contains the audio data in bytes. Note: This property expects signed PCM8 data. To convert unsigned PCM8 to signed PCM8, subtract 128 from each byte. |
format[get, set]
|
AudioStreamSample | Audio format. See format constants for values.
|
loopBegin[get, set]
|
long | Loop start in bytes. |
loopEnd[get, set]
|
long | Loop end in bytes. |
loopMode[get, set]
|
AudioStreamSample | Loop mode. See loopmode constants for values.
|
mixRate[get, set]
|
long | The sample rate for mixing this audio. |
stereo[get, set]
|
bool | If true, audio is stereo.
|
Methods
| Name | Description |
|---|---|
getData
|
|
getFormat
|
|
getLoopBegin
|
|
getLoopEnd
|
|
getLoopMode
|
|
getMixRate
|
|
isStereo
|
|
saveToWav
|
Saves the AudioStreamSample as a WAV file to path. Samples with IMA ADPCM format can't be saved.
Note: A extension is automatically appended to path if it is missing.
|
setData
|
|
setFormat
|
|
setLoopBegin
|
|
setLoopEnd
|
|
setLoopMode
|
|
setMixRate
|
|
setStereo
|
Enums
| Name | Description |
|---|---|
Constants
|
|
Format
|
|
LoopMode
|