How to: Stop Playing Sounds in the Background in Visual Basic
This example stops a sound playing in the background.
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 How to: Insert IntelliSense Code Snippets.
This code example can run only within a Windows Forms or console application. For more information, see Stop.