love.audio.newSource( file, type )
Creates a new Source from a file.
Sources created from SoundData are always static.
Synopsis
source = love.audio.newSource( file, type )
Parameters
file |
string |
The file to create a Source from. |
type |
SourceType |
Streaming or static source. |
Returns
source |
Source |
A new Source that can play the specified audio. |
Examples
Load background music and play it
bgm = love.audio.newSource("bgm.ogg", "stream")
love.audio.play(bgm)
Load a sound effect and play it
sfx = love.audio.newSource("sfx.wav", "static")
love.audio.play(sfx)