问题
I want to play two audio files simultaneously in WP8 from within the same app:
- The first one will be launched by "BackgroundAudioPlayer.Instance.Play();".
- The second one will be launched by an HTML5 "audio" element within a Html file of the app.
The scenario would be something like this:
- When the user launches the app, the background music starts playing.
- When the user goes to a particular Html page of the app, its associated music starts playing.
- When the user switches the app or locks the screen, the music of that Html page stops, however, the background music keeps on playing until the app is closed.
- When the user comes back to that Html page again, its associated music starts playing along with the background music.
Appreciate your suggestions on this.
Thanks.
回答1:
Together, we have tested a very simple App trying to play simultanously two audio files. The App worked like this:
- Play button has started audio file via BAP
- then we have navigated in
WebBrowser
to a page (located in IsolatedStorage) where there was an audio element - and we have pushed play button in
WebBrowser
(still BAP playing in the background)
It turned out that WebBrowser
uses BAP as a player, so after we have pressed the button, our poor BAP playing in the background was terminated and replaced with new fresh one from WebBrowser
.
It means that our magnificent idea and superb plan had withered on the vine.
回答2:
So crap....
You'd need to build a player in your app so it could run simultaneously to the native one.
This explains why you cant run a gif and play music simultaneously.
来源:https://stackoverflow.com/questions/21797481/playing-multiple-audio-files-simultaneously-in-wp8