简体   繁体   中英

C# WinForms how to play 2 sounds in the same time

I am using the command: SoundPlayer cave = new SoundPlayer(WindowsFormsApplication5.Properties.Resources.Cave_Music; to play a melody in the background, however if I want to add let's say a Beep in the same time with the melody, the melody stops. I couldn't find any answers on older questions of the same time, so how do I play 2 sounds in the same time? Prefferably booth of them from a Resorce.

Thanks alot !

I highly recommend to use DirectSound or similar API for such purposes.

Also, you can implement this using System.Windows.Media.MediaPlayer class.

The multi-threaded example is here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM