Re: Getting audio to work?
Posted: Thu Mar 29, 2012 11:57 am
If you renamed it easily how baconhawka7x said, try to convert the original .mp3 to .ogg with Super 2012 or another audio converter programm your choice.
I'm also a beginner, but if you want to set the audio function in a extern .lua file try it like this:
audio.lua:
main.lua:
This will start the "playMusic" function in the audio.lua when the game starts.
Please correct me, if this is wrong or there are better solutions.
I'm also a beginner, but if you want to set the audio function in a extern .lua file try it like this:
audio.lua:
Code: Select all
function playMusic()
music = love.audio.newSource("hurricane.ogg")
love.audio.setVolume(1.0)
love.audio.play(music)
end
Code: Select all
require "audio"
function love.load()
playMusic()
end
This will start the "playMusic" function in the audio.lua when the game starts.
Please correct me, if this is wrong or there are better solutions.