1

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.

Patrik
  • 1,286
  • 1
  • 31
  • 64
  • That doesn't work on Windows Mobile. Is that what you are trying to get this to work on? Where is the code you tried? –  Jan 01 '13 at 15:44

1 Answers1

1

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.

Alan
  • 7,875
  • 1
  • 28
  • 48
  • I am using Win CE 6.0 R3 for ARM... But I think that you are right. WaveOut has a good chances to do what I need. I am going to try but need to rework a lot. – Patrik Jan 02 '13 at 16:02
  • @Patrik It certainly takes some figuring out, the only other choice I know of would be DirectSound if your device supports it. – Alan Jan 02 '13 at 16:28