How to: Stop Playing Sounds in the Background in Visual Basic
This example stops a sound playing in the background.
Background playing lets the application execute other code while the sound plays. For more information, seeand .
In general, when an application plays a looping sound, it should stop the sound at some point.
Use the My.Computer.Audio.Stop method to stop the application's currently playing background or looping sound.
This code example is also available as an IntelliSense code snippet. In the code snippet picker, it is located in Windows Forms Applications > Sound. For more information, see.
Compiling the Code
This code example can run only within a Windows Forms or console application. For more information, see.