views:

37

answers:

2

Hi

I'm trying to play a set of audio wav files being sent over the network for playing as a overall sound stream. How do i get a set of these chunks to play one after the other with no sound breaks or blips using NAudio? I can have 1 file play, but I cant find a way to detect when one sound file ends or how to attach the 2nd sound file onto the 1st.

Currently when i try to play 2 files, the 1st track is cut off immediately and the only the final sound track is played properly

Any help would be greatly appreciated.

+1  A: 

This NAudio tutorial shows how to mix streams in real-time. It seems to support positioning (so you can mix the second stream right at the end of the first).

http://opensebj.blogspot.com/2009/02/naudio-tutorial-2-mixing-multiple-wave.html

Adal
A: 

another approach is to create your own custom WaveStream that contains two WaveFileReaders. In the Read method, return data from the first until it runs out, then start returning data from the second. You'll need to do a little more if you need to support repositioning during playback, but apart from that it should be very straightforward

Mark Heath