Play sounds with managed code
I've been trying to create a sound library as a learning project. I get the reading and parsing, I just don't understand how to actually make sound come out of the speaker. I've looked around for quite some time now, but I could never find something that explains this. It seems to be开发者_运维技巧 trivial. Am I missing something here? How do I do this in C#?
I would try NBass. It's free and open source, you can peek how they do it in detail.
You can also use the Microsoft Media Player SDK, if you prefer, or the media layer from WPF, which is probably merely the same I guess.
If you want to output things directly then the managed DirectX can help you out, have a look at DirectX.AudioVideoPlayback
.
Could you use System.Media.SoundPlayer?
http://msdn.microsoft.com/en-us/library/system.media.soundplayer.aspx
精彩评论