Play wav file async multiple times with .net

后端 未结 4 1051
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-10 19:00

I have an app that I need to play a wav file when a key is pressed, I use the SoundPlayer class but if another sound is being played when a new key is pressed, it stops the

4条回答
  •  佛祖请我去吃肉
    2020-12-10 19:33

    If you're asking, "how can I play multiple sounds at once" then SoundPlayer will never be the answer. PlaySound, I believe, is also similarly limited.

    You might look at this question and this question for more options on sound APIs. I took a quick look at SDL and SDL Mixer and thought that SDL was too primitive (you have to mix the sounds yourself) and SDL Mixer was too heavyweight (it's all that and a bag of chips - unlimited channels of mixing and music (mp3, ogg, midi, etc)). I couldn't see an online reference for BASS's C# bindings, but it's free for non-commercial use.

提交回复
热议问题