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 is able to hold a certain number of samples.

soundData = lovr.data.newSoundData(filename)

Arguments

NameTypeDescription
filenamestringThe filename of the sound to decode.

Returns

NameTypeDescription
soundDataTextureDataThe new TextureData.

soundData = lovr.data.newSoundData(samples, sampleRate, bitDepth)

Arguments

NameTypeDefaultDescription
samplesnumberThe total number of samples in each channel.
sampleRatenumber44100The number of samples per second.
bitDepthnumber16The number of bits stored for each sample.

Returns

NameTypeDescription
soundDataTextureDataThe new TextureData.

soundData = lovr.data.newSoundData()

Arguments

None

Returns

NameTypeDescription
soundDataTextureDataThe new TextureData.

soundData = lovr.data.newSoundData(blob)

Arguments

NameTypeDescription
blobstringThe Blob containing sound data to decode.

Returns

NameTypeDescription
soundDataTextureDataThe new TextureData.

See also