Answer the question
In order to leave comments, you need to log in
C# SoundPlayer streams?
In general, at the start of the form, I play music. But there is also a sound on the buttons, when I press them, the background music is interrupted. How to make it so that when you press a button there is a sound, but the background music does not stop
Answer the question
In order to leave comments, you need to log in
Create a stream when you click on the button and start the sound in it, then end the stream.
In general, I found a solution.
In order for you to play background music, and the buttons were also used with sound without interrupting the background music. I advise you to use WMPLib for background music, which you can connect through NuGet package management.
Next, write the following code:
public WMPLib.WindowsMediaPlayer WMP = new WMPLib.WindowsMediaPlayer();
WMP.URL = "Путь до .mp3 файла";
WMP.controls.play();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question