Audio Error

display.setStatusBar(display.HiddenStatusBar) local audioIsPlaying = true local sndSpin = audio.loadSound( "audio/spin.mp3") local sndMusic = audio.loadStream ( "audio/electrohouse.wav" ) local function playSound() if audioIsPlaying then audio.play(sndMusic) end end Runtime:addEventListener( "tap", playSound)

When I try to run, I can’t get ‘sndMusic’ to work only ‘sndSpin’ works

Hi @mejon,

Are you sure the file isn’t corrupted in any way? What if you try loading the “sndMusic” (electrohouse.wav) file as a sound instead of a stream? Well, not as a permanent solution since longer tracks should be streamed, but just as a test…

Brent

Hi Brent,

I substituted ‘sound’ instead of ‘stream’ but there is still an error.

68b05ae1b8fc40c08b343f1dfca4debd.png

I highly suspect the sound is bad.  Have you edited it with something like Audacity to make sure it’s good?  Also what format is it in?.. that is, is it stereo, mono?  11K, 22K 44K sample rate?  It could be an odd sample rate that we don’t support.  There could be a corrupt header and maybe audacity can save it out while fixing it.

Rob

Hi @mejon,

Are you sure the file isn’t corrupted in any way? What if you try loading the “sndMusic” (electrohouse.wav) file as a sound instead of a stream? Well, not as a permanent solution since longer tracks should be streamed, but just as a test…

Brent

Hi Brent,

I substituted ‘sound’ instead of ‘stream’ but there is still an error.

68b05ae1b8fc40c08b343f1dfca4debd.png

I highly suspect the sound is bad.  Have you edited it with something like Audacity to make sure it’s good?  Also what format is it in?.. that is, is it stereo, mono?  11K, 22K 44K sample rate?  It could be an odd sample rate that we don’t support.  There could be a corrupt header and maybe audacity can save it out while fixing it.

Rob