开发者

How can i get 2 wavefilereaders to play sequencially?

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 开发者_Python百科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.


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜