Play multiple .wav files simultaniously with Naudio or Win API
Asked Answered
I

2

6

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.

Injustice answered 25/4, 2014 at 12:22 Comment(1)
This project does some simple audio mixing, so it might be a good start.Ortrud
H
5

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)

Harrod answered 26/4, 2014 at 15:58 Comment(1)
It seems that there's a limit on how many WaveOuts can be used. I got an exception "memory allocation error", but it's not an OutOfMemoryException.Galang
A
-3

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

Amour answered 25/4, 2014 at 14:47 Comment(2)
How does this relate to the NAudio library?Galang
Link is dead. This is why we ask people to summarize the articles they link to, because now this answer provides no value at all.Leta

© 2022 - 2024 — McMap. All rights reserved.