Kindle Fire Audio not playing background music.

This one has me puzzled. Given this code:

 print("loading music")  
 storyboard.backgroundMusic = audio.loadStream("audio/TP\_BkgrdMusic.wav") -- need background sound.  
 print("audio", storyboard.backgroundMusic)  
 audio.reserveChannels(1)  
 audio.setVolume(0.5, { channel = 1 })  
 if storyboard.settings.musicOn then  
 print("playing music")  
 audio.play(storyboard.backgroundMusic, { channel = 1, loops = -1 } )  
 end  

Now all my other sounds, loaded by audio.loadSound() are playing as well as android sounds can (laggy). This code works perfectly on iOS.

I am seeing all of the print statements, including the “playing music”, but not a drop of sound. I have commented out the reserve channel, the set volume, the if musicOn statements. I’ve converted the sound to various formats, all of which play on the KF’s audio player.

The only weirdness is the print(“audio”, storyboard.backgroundMusic) prints audio, but storyboard.backgroundMusic is blank, not nil, not a table…

I’m puzzled.

any ideas? [import]uid: 19626 topic_id: 27212 reply_id: 327212[/import]

I have made zero progress with this problem, but I do have more information.
First, my game OmniBlaster plays it’s background music perfectly on the Kindle Fire. The app I’m working on also plays its other audio just fine. I’m 100% sure my code is solid and that it might be the audio track itself causing issues with the KF (it plays fine in the Simulator and on iOS devices).

Just for fun, I took an MP3 that I know plays (from OmniBlaster) and put it in my new app and guess what… No audio.

I have a print statement that prints the word audio and then whatever the handle is from audio.loadStream(). In the simulator, I get the word audio and a hex number, which is typical of a table or function, which is what I would expect from the return from audio.loadStream() however on the KF, I don’t get anything output other than the hard coded word “audio”. No hex, no nil, either space or an empty string, nothing visible.

I would expect that if audio.loadStream() failed, I would get a nil. I also tried this with audio.loadSound().

So I know my sound is good. I know my logic is good.

What would cause audio.loadStream() to fail on the KF (and potentially on Amazon) and not elsewhere?

Can someone through me a bone here and offer up some ideas?

Thanks
Rob [import]uid: 19626 topic_id: 27212 reply_id: 110772[/import]

Well I have tracked down my problem… I hope… Then again…

On Android, and maybe just the KF, not for sure, there seems to be an Application Pause and Resume event sent if you to a media.playVideo().

During a suspend, I stop the background music from playing and then resume it when it comes back. I had a bug there, but fixing it didn’t fix my problem. Killing the splash video fixes the sound.

So one of two things seems to be happening. Doing an audio.pause(1) (my music plays on channel 1) before sound is playing does un-predictable things to the channel. or 2) the media.playVideo() on the KF is taking that audio channel and not reserving it.

My immediate fix is to drop the splash video in favor of a fixed image, but I would like to get this working with the video. So Ansca, you may be getting a bug report tomorrow once I finish isolating the problem.
[import]uid: 19626 topic_id: 27212 reply_id: 110794[/import]

I love filing bugs… Bug Report: #14826

In this app, my client has a small video they play for their loading screen. I’m using media.playVideo() to do this. After that runs, the audio api is left in some funky state and while some of my sounds play, I could not get the background track (the first sound I play after the video finishes) to play.

Taking out the video fixes the sound. However in my test project, other sounds did not want to play, so it may not be limited to the first sound.

Have at it Ansca!
[import]uid: 19626 topic_id: 27212 reply_id: 110892[/import]