Playing multiple audio files simultaneously in WP8

我是研究僧i 提交于 2019-12-13 20:05:39

问题


I want to play two audio files simultaneously in WP8 from within the same app:

  1. The first one will be launched by "BackgroundAudioPlayer.Instance.Play();".
  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!