سؤال

I am trying to make WAV Sound Player in .NET Compact Framework 3.5 for Win CE but encountered problems. I need to play two sound simultaneously but System.Media.SoundPlayer breaks the execution when the second SoundPlayer starts playing.

Is there any solution, some library, framework or API call to find the solution ?

I am trying to do something like

SoundPlayer player1 = new SoundPlayer("ding.wav");
SoundPlayer player2 = new SoundPlayer("chimes.wav");
player1.PlayAsync();
player2.PlayAsync();

The situation I encountered player2 breaks playing of the player1. I would like to play both at the same time. Simple as that.

هل كانت مفيدة؟

المحلول

SoundPlayer is for simple sounds, I've not had to play sounds simultaneously, but I have had to P/Invoke the WaveOut API to do things exactly how I wanted. You didn't say which operating system (Version of CE) that you are using, but check out the WaveOut Windows API.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top