Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Play multiple .wav files simultaniously with Naudio or Win API

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.

like image 486
T M Avatar asked Nov 01 '22 01:11

T M


1 Answers

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)

like image 177
Mark Heath Avatar answered Nov 15 '22 05:11

Mark Heath