I am not able to play audio in the background when displaying roScreen in front. What I am doing is
1- Show an roScreen with roVideoPlayer. (works fine)
after playback of some videos
2- Show same roScreen with different graphics and roAudioPlayer playing background music for some time (almost 30 seconds). (roScreen displays graphics fine but not audio playback in the background. I am pausing roVideoPlayer before displaying this screen)
In the debug console I get roAudioPlayer events with message "startup progress" but when startup progress reaches to 999 after that neither audio is played nor I get any other roAudioPlayer event. And after that when this screen closes and goes to next screen (before which I call roAudioPlayer.Stop()) I get events "startup progress" with value 1000 and "start of play" with value 0. But at this point audio is not played because I have already called roAudioPlayer.Stop() method.
So, I am not able to understand whether it is an issue of usage of a lot of memory because of many memory hungry components or we cannot use roVideoPlayer and roAudioPlayer objects simultaneously (although roVideoPlayer is paused)???? Because same audio clip works fine when I put its URL in roAudioPlayer example from sdkdocs.roku.com
Here is the code snippet:
audioPlayer = CreateObject("roAudioPlayer")
port = CreateObject("roMessagePort")
audioClip = CreateObject("roAssociativeArray")
audioClip.url = "http://www.theflute.co.uk/media/BachCPE_SonataAmin_1.wma"
audioPlayer.AddContent(audioClip)
audioPlayer.SetLoop(true)
audioPlayer.SetMessagePort(port)
audioPlayer.Play()
showScreen()
in the event loop after 30 seconds
audioPlayer.Stop()
updateScreen()
showScreen()