lovr.data.newSoundData
Creates a new SoundData. You can pass a filename or Blob to decode, an existing AudioStream to decode audio samples from, or you can create an empty SoundData that can hold a certain number of samples.
soundData = lovr.data.newSoundData(filename)
Arguments
Name | Type | Description |
filename | string | The filename of the sound to decode.
|
Returns
Name | Type | Description |
soundData | SoundData | The new SoundData.
|
soundData = lovr.data.newSoundData(samples, sampleRate, bitDepth, channels)
Arguments
Name | Type | Default | Description |
samples | number | | The total number of samples for each channel.
|
sampleRate | number | 44100 | The number of samples per second.
|
bitDepth | number | 16 | The number of bits stored for each sample.
|
channels | number | 2 | The number of channels in the sound (1 for mono, 2 for stereo).
|
Returns
Name | Type | Description |
soundData | SoundData | The new SoundData.
|
soundData = lovr.data.newSoundData()
Arguments
None
Returns
Name | Type | Description |
soundData | SoundData | The new SoundData.
|
soundData = lovr.data.newSoundData(blob)
Arguments
Name | Type | Description |
blob | string | The Blob containing compressed sound data to decode.
|
Returns
Name | Type | Description |
soundData | SoundData | The new SoundData.
|
See also