[SOLVED] Audio Problem

Hello Community, I’m testing a web tutorial on my device (http://www.youtube.com/watch?v=6TsDdLY7VXk) , but I have a problem with audio, I’m using my own audio files (.wav), when I test it in the Simulator the app runs perfect, but when I test it into my device, the WinSound and FailSound FAIL!, they are not played, what can I do?

Heres the code

[code]
–Hide Status Bar
display.setStatusBar ( display.HiddenStatusBar )

–Variables
local wScreen = display.contentWidth
local hScreen = display.contentHeight
local mRandom = math.random
local totalCircles = 20
local screenCircles = 0
local gameTime = 10
local gameReady = false
local gameCountdown

–Texts
local displayText = display.newText ( “Wait”, 0, 0, native.systemFont, 32 )
displayText:setReferencePoint ( display.BottomLeftReferencePoint )
displayText.x = 0
displayText.y = hScreen
local timeText = display.newText ( gameTime, 0, 0, native.systemFont, 32 )
timeText:setReferencePoint ( display.BottomRightReferencePoint )
timeText.x = wScreen
timeText.y = hScreen
timeText.isVisible = false

–Audio
local soundtrack = audio.loadStream ( “Soundtrack.wav” )
local tapSound = media.newEventSound ( “TapSound.wav” )
local winSound = audio.loadSound ( “WinSound.wav” )
local failSound = audio.loadSound ( “FailSound.wav” )

–Functions
local spawnCircles = {}
local startGame = {}
local removeCircles = {}
local startCountdown = {}
local gameTimer = {}
local statusGame = {}

–Main Function
local function main ()
audio.play ( soundtrack, {loops = -1} )
local spawnTimer = timer.performWithDelay ( 200, spawnCircles, totalCircles )
end

–Spawn Circles
function spawnCircles ()
local circle = display.newCircle ( 0, 0, 32 )
circle.strokeWidth = 4
circle:setStrokeColor ( 255, 0, 0 )
circle:setReferencePoint ( display.CenterReferencePoint )
circle.x = mRandom ( 50, wScreen - 50 )
circle.y = mRandom ( 50, hScreen - 100 )
screenCircles = screenCircles + 1
circle:addEventListener ( “tap”, removeCircles )
–Call Start Game Function
startGame ()
end

–Start Game
function startGame ()
if ( screenCircles == totalCircles ) then
gameReady = true
displayText.text = “Go”
–Call Countdown Function
startCountdown ()
end
end

–Remove Circles
function removeCircles (e)
if ( gameReady == true ) then
media.playEventSound ( tapSound )
e.target:removeSelf ()
screenCircles = screenCircles - 1
–Getting Status Game
statusGame ()
return true
end
end

–Start Countdown
function startCountdown ()
timeText.isVisible = true
transition.from ( timeText, {alpha = 0} )
gameCountdown = timer.performWithDelay ( 1000, gameTimer, gameTime )
end

–Game Timer
function gameTimer ()
transition.from ( timeText, {alpha = 0} )
gameTime = gameTime - 1
timeText.text = gameTime
–Getting Status Game
statusGame ()
end

–Ending Game
function statusGame ()
if ( screenCircles == 0 and gameTime > 0 ) then
audio.stop ( soundtrack )
displayText.text = “Win!”
audio.play ( winSound )
timer.cancel ( gameCountdown )
gameReady = false
elseif ( screenCircles ~= 0 and gameTime == 0 ) then
audio.stop ( soundtrack )
displayText.text = “Fail”
audio.play ( failSound )
gameReady = false
end
end

main () [import]uid: 81091 topic_id: 17864 reply_id: 317864[/import]

Try using another File Format - maybe the sound is too big.
or change loadSound(…) to loadStream(…)

Maybe that helps! [import]uid: 13097 topic_id: 17864 reply_id: 68184[/import]

I see you’re using mixed-caps filenames. Make sure your filenames have the same capitalization as you’ve specified in your main.lua. The simulator is case-*in*sensitive, devices are not. [import]uid: 70847 topic_id: 17864 reply_id: 68203[/import]

Perfect, I changed the audio.loadSound to audio.loadStream. Thanks guys. [import]uid: 81091 topic_id: 17864 reply_id: 68222[/import]