I found:
Code: Select all
source = love.audio.newSource( file, type )
Code: Select all
love.audio.play( source )
Code: Select all
music = love.audio.newSource( libs/gangstersparadise, mp3 )
love.audio.play( music )
Code: Select all
source = love.audio.newSource( file, type )
Code: Select all
love.audio.play( source )
Code: Select all
music = love.audio.newSource( libs/gangstersparadise, mp3 )
love.audio.play( music )
michaeladair wrote:Basically I want to add some background music to my game.
I found:AndCode: Select all
source = love.audio.newSource( file, type )
Do I just make it like this?Code: Select all
love.audio.play( source )
Any help would be great, thank you.Code: Select all
music = love.audio.newSource( libs/gangstersparadise, mp3 ) love.audio.play( music )
Code: Select all
music = love.audio.newSource( 'libs/gangster paradise.mp3', 'dynamic' )
music:setLooping( true ) --so it doesnt stop
music:play()
It says that dynamic is an invalid source type...S0lll0s wrote:michaeladair wrote:Basically I want to add some background music to my game.
Any help would be great, thank you.Code: Select all
music = love.audio.newSource( 'libs/gangster paradise.mp3', 'dynamic' ) music:setLooping( true ) --so it doesnt stop music:play()
Then what should I do instead of it? And should i have this code inside a function?Doctory wrote:don't do dynamic.
Code: Select all
music = love.audio.newSource( 'libs/gangster paradise.mp3', 'stream' )
music:setLooping( true ) --so it doesnt stop
music:play()
Either in love.load() or not in a function. (Just don't put it in love.update or love.draw)michaeladair wrote:And should i have this code inside a function?
Whoops, my fault for not looking it up in the wiki againEvine wrote:"stream" or "static" is a thing, "dynamic" is not.
https://www.love2d.org/wiki/SourceTypeCode: Select all
music = love.audio.newSource( 'libs/gangster paradise.mp3', 'stream' ) music:setLooping( true ) --so it doesnt stop music:play()
Either in love.load() or not in a function. (Just don't put it in love.update or love.draw)michaeladair wrote:And should i have this code inside a function?
Users browsing this forum: Google [Bot] and 6 guests