SoundPlayer.Stop Method

Stops playback of the sound if playback is occurring.

Namespace:  System.Media
Assembly:  System (in System.dll)

'Declaration
Public Sub Stop

The following code example demonstrates the use of the Stop method to halt a .wav file that is currently playing. This code example is part of a larger example provided for the SoundPlayer class.

player.Stop()
ReportStatus("Stopped by user.")

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft