Play multiple .wav files simultaniously with Naudio or Win API

半腔热情 提交于 2019-12-10 14:00:01

问题


Hi All I have an application which receives simultaneously wav data through multiple threads from different UDP ports:

  1. Is it possible to play all received wav data at same time, simultaneously, using Wave Out API?

  2. Is it possible to play all received wav data at same time, simultaneously, using NAudio? does NAudio objects thread safe?

saying play simultaneously I mean case when a file played in media player and something in YouTube played at the same time and you can hear both sound from your speakers at the same time:

Any help or hint would be appreciated. Thanks in advance.


回答1:


Yes, you can do it with multiple instances of WaveOut (one for each stream), or you can do it with a single WaveOut and mix it yourself (e.g. with the MixingSampleProvider)




回答2:


I think that you can do that.

this tutorial can help you :
http://msdn.microsoft.com/en-us/magazine/cc163455.aspx

It explane how to integrate a video but I think that the used Library can play audio



来源:https://stackoverflow.com/questions/23293062/play-multiple-wav-files-simultaniously-with-naudio-or-win-api

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