We help IT Professionals succeed at work.

hou to play .wav audio file in asp.net application

polythought
polythought asked
on
Medium Priority
3,094 Views
Last Modified: 2006-12-02
hou to play .wav audio file in asp.net application
Comment
Watch Question

CERTIFIED EXPERT

Commented:
CERTIFIED EXPERT

Commented:
or

Public Declare Function playa Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

Public Sub PlayWav(sFile As String)
    If Dir(sFile$) <> "" Then Call playa(sFile, SND_FLAG)
End Sub

PlayWav("c:\myfile.wav")

.Net Senior Developer
CERTIFIED EXPERT
Commented:
you can make a link with the url where is the wav files

<a href='....file.wav'>play</a>

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Commented:
Use an object-tag to embed windows-media player in your html-page and point it to the url of the wav-file.

See the this link for an example:http://www.mioplanet.com/rsc/embed_mediaplayer.htm

Commented:
Hi TheLeaderone,

The comments from YZlat or not a solution the problem.
My solution and the one from lem2802 would work.

Regards,
Richard
CERTIFIED EXPERT

Commented:
Thargol, could you do me a favor and explain what is wrong with my solution

Commented:
Hi, yZlat

Your solution is for vb.net, so a client application. The question was for asp.net, so a server based web application.

Btw in vb.net 8 (Framework 2.0) you can play audio in vb with the following line:

my.Computer.Audio.Play(filename)

But again this is not a way to play audio in a website.

Regards,
Richard


Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.