Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
The SoundPlayer class enables you to easily include sounds in your applications.
The SoundPlayer class can play sound files in the .wav format, either from a resource or from UNC or HTTP locations. Additionally, the SoundPlayer class enables you to load or play sounds asynchronously.
You can also use the SystemSounds class to play common system sounds, including a beep.
Name | Description |
---|---|
SoundLocation property | The file path or Web address of the sound. Acceptable values can be UNC or HTTP. |
LoadTimeout property | The number of milliseconds your program will wait to load a sound before it throws an exception. The default is 10 seconds. |
IsLoadCompleted property | A Boolean value indicating whether the sound has finished loading. |
Load method | Loads a sound synchronously. |
LoadAsync method | Begins to load a sound asynchronously. When loading is complete, it raises the OnLoadCompleted event. |
Play method | Plays the sound specified in the SoundLocation or Stream property in a new thread. |
PlaySync method | Plays the sound specified in the SoundLocation or Stream property in the current thread. |
Stop method | Stops any sound currently playing. |
LoadCompleted event | Raised after the load of a sound is attempted. |
.NET Desktop feedback feedback
.NET Desktop feedback is an open source project. Select a link to provide feedback:
Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register now