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.
== Function ==
=== Synopsis ===
<source lang="lua">
soundData = love.sound.newSoundData( filename )
</source>
=== Arguments ===
{{param|string|filename|The file name of the file to load.}}
=== Returns ===
{{param|SoundData|soundData|A new SoundData object.}}
== Function ==
=== Synopsis ===
<source lang="lua">
soundData = love.sound.newSoundData( file )
</source>
=== Arguments ===
{{param|File|file|A File pointing to an audio file.}}
=== Returns ===
{{param|SoundData|soundData|A new SoundData object.}}
== Function ==
=== Synopsis ===
<source lang="lua">
soundData = love.sound.newSoundData( decoder )
</source>
=== Arguments ===
{{param|Decoder|decoder|Decode data from this Decoder until EOF.}}
=== Returns ===
{{param|SoundData|soundData|A new SoundData object.}}
== Function ==
=== Synopsis ===
<source lang="lua">
soundData = love.sound.newSoundData( samples, rate, bits, channels )
</source>
=== Arguments ===
{{param|number|samples|Total number of samples.}}
{{param|number|rate (44100)|Number of samples per second}}
{{param|number|bits (16)|Bits per sample (8 or 16).}}
{{param|number|channels (2)|Either 1 for mono or 2 for stereo.}}
=== Returns ===
{{param|SoundData|soundData|A new SoundData object.}}
== Examples ==
=== Loading SoundData from files ===
<source lang="lua">
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")
</source>
== See Also ==
* [[parent::love.sound]]
* [[Constructs::SoundData]]
[[Category:Functions]]
{{#set:Description=Creates a new SoundData. }}
{{#set:Since=000}}
== Other Languages ==
{{i18n|love.sound.newSoundData}}