Click here to Skip to main content
15,904,153 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
How do I play a .wav Sound on ASP.net vb.

I get errors when I try this method:

VB
Imports System.Media
...
        Dim spWave As SoundPlayer = New SoundPlayer("../path/WindowsError.wav")
        spWave.Play()
Posted
Comments
[no name] 1-Jul-14 8:46am    
Why would you annoy your webmaster by playing noise on his server machine?
Sergey Alexandrovich Kryukov 1-Jul-14 12:19pm    
A Web master will hardly ever hear it. Maybe a person cleaning those racks with blade host computers, but only if someone plugs the speakers in some of them... :-)
—SA

1 solution

You have to code it on the client side to play on the client browser not the server, check these out:
1. Play-WAV-sound-files-in-ASP.Net-using-JavaScript[^]
2. html5_audio[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900