Creates new SoundData from a filepath, File, or Decoder. It's also possible to create SoundData with a custom sample rate, channel and bit depth.
The sound data will be decoded to the memory in a raw format. It is recommended to create only short sounds like effects, as a 3 minute song uses 30 MB of memory this way.
soundData = love.sound.newSoundData( filename )
string filenameSoundData soundDatasoundData = love.sound.newSoundData( file )
File fileSoundData soundDatasoundData = love.sound.newSoundData( decoder )
Decoder decoderSoundData soundDatasoundData = love.sound.newSoundData( samples, rate, bits, channels )
number samplesnumber rate (44100)number bits (16)number channels (2)SoundData soundDatawav = 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")
© 2006–2016 LÖVE Development Team
Licensed under the GNU Free Documentation License, Version 1.3.
https://love2d.org/wiki/love.sound.newSoundData