0

ASP.Net WebForm Sound is not playing in Windows Server 2008 R2 with below code.

note that its working fine in Windows 7.

Dim spath As String
    spath = "D:\Run\Sound.wav"
    Dim mysound As Media.SoundPlayer
    mysound = New Media.SoundPlayer(spath)
    mysound.Play()

    System.Threading.Thread.Sleep(30000)

    Dim mysound2 As Media.SoundPlayer
    mysound2 = New Media.SoundPlayer(spath)
    mysound2.Play()

regards, Basit.

  • 1
    My guess is you expect the sound to play in the browser of the user that visits the site. Well, that is not going to work, the sound will be played on the server itself (if at all due to user rights). Use html sounds: https://stackoverflow.com/questions/9419263/how-to-play-audio – VDWWD Sep 20 '22 at 12:42
  • Thanks for your reply, i want to run audio on form load. – Basit Sarguroh Sep 21 '22 at 04:50
  • I noticed that above code is working fine only with visual studio, i tried in windows 7 IIS is not working, means something setting need to do with IIS? – Basit Sarguroh Sep 21 '22 at 04:55
  • I also checked MIME Type in IIS audio/wav extension .wav is available. – Basit Sarguroh Sep 21 '22 at 04:58

0 Answers0