If you can't find what you need using the site search on the toolbar above, or if you need more detailed help or just need to be pointed in the right direction, post your question to the newly opened kadaitcha.cx forums. Membership is free.

How to Play a .wav Sound or System Sound

The My.Computer.Audio.Play and My.Computer.Audio.PlaySystemSound methods can be used to play .wav sound files and system sounds.

My.Computer.Audio.Play(FileName, AudioPlayMode.Background)


Sample Code

Dim dr As DialogResult
Dim OpenFileDialogWav As New OpenFileDialog

OpenFileDialogWav.Filter = "Sound files (.wav)|*.wav"
dr = OpenFileDialogWav.ShowDialog()

If dr <> Windows.Forms.DialogResult.OK Then
    Exit Sub
End If

My.Computer.Audio.Play(OpenFileDialogWav.FileName, AudioPlayMode.Background)

To use the sample code, create a Windows Forms project and paste the code into a Button on the default form.

Download Sample Project

Also See

How to Play a .wma, .mp3 or other Music
How to Host Windows Media Player to Play Music & Video

All code examples on this site have been developed for .Net Framework 3.5