Audio

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Magahaka
Prole
Posts: 1
Joined: Fri Nov 23, 2012 2:10 pm

Audio

Post by Magahaka »

Hello, today I create my own game main menu. And I want to use music on the main menu. But I don't know how I can do that. Songs format is mp3. How I can start the music, then the game is starting?
User avatar
Qcode
Party member
Posts: 170
Joined: Tue Jan 10, 2012 1:35 am

Re: Audio

Post by Qcode »

So to get the file in memory you have to use love.audio.newSource() in love.load. After that you can call love.audio.play(). Both of these should only be called once, in a function like love.load not love.update or love.draw. Also if you want to you can set your music to loop with Source:setLooping.
Just tell me if you need me to go into more detail about how to call these properly.
~Qcode
P.S Also .mp3's can be buggy with love. If possible, try converting it into a .ogg file which generally work better and take up less file size!
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 5 guests