Difference between revisions of "love.sound.newSoundData"

 
m (1 revision: Imported docs from potato.)
(No difference)

Revision as of 15:54, 14 February 2010


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