love.sound.newSoundData

Creates new SoundData from a Decoder. Fully expands the encoded sound data into raw sound data. Only do this for small files.

Function

Synopsis

sounddata = love.sound.newSoundData( decoder )

Arguments

Decoder decoder
Decode data from this Decoder until EOF.

Returns

SoundData sounddata
A SoundData object.

Function

Synopsis

sd = love.sound.newSoundData( filename )

Arguments

string filename
The filename of the file to load.

Returns

SoundData sd
A new SoundData object.

Function

Synopsis

sounddata = love.sound.newSoundData( samples, rate, bits, channels )

Arguments

number samples
Total number of samples.
number rate
Number of samples per second
number bits
Bits per sample (8 or 16).
number channels
Either 1 for mono, or 2 for stereo

Returns

SoundData sounddata
A new SoundData object, or zero in case of errors.

Examples

Loading SoundData from files

wav = love.sound.newSoundData("doom.wav")
-- Beware: if doom.mp3 is a huge file, it will take 
-- ages to decode.
mp3 = love.sound.newSoundData("doom.mp3")

See Also