Play a sound

R

Rick Lederman

I need to play a .wav file from my program. I know how to do it from a
regular desktop program but have no idea how to do it from asp.net. My
application regularly plays short (4 seconds or less) wave files depending
on the results of an input. I'm about to start the conversion from the
normal fat client to an asp.net version and the playing of a wav file is
esential. Any ideas?

Rick Lederman
www.soaringsoftware.com
 
J

Jeff Evans

Rick Lederman said:
I need to play a .wav file from my program. I know how to do it from a
regular desktop program but have no idea how to do it from asp.net. My
application regularly plays short (4 seconds or less) wave files depending
on the results of an input. I'm about to start the conversion from the
normal fat client to an asp.net version and the playing of a wav file is
esential. Any ideas?


This is not something you can accomplish with ASP.NET, per se, as it is
technically can only spit out HTML to a client. Presumably, you will have
to use ASP.NET to output a javascript function to play a sound. Sorry, I
don't know how to do this personally, but google "play sound javascript".
 
V

vMike

Rick Lederman said:
I need to play a .wav file from my program. I know how to do it from a
regular desktop program but have no idea how to do it from asp.net. My
application regularly plays short (4 seconds or less) wave files depending
on the results of an input. I'm about to start the conversion from the
normal fat client to an asp.net version and the playing of a wav file is
esential. Any ideas?

Rick Lederman
www.soaringsoftware.com
You can put a <bgsound id="sound1" runat="server"/> on your page and then in
code put the following.

Protected sound1 as htmlgenericcontrol
sound1.attributes("src") = "../yourwavefile.wav"

if you want nothing to play then you just reset it to
sound1.attributes("src") = ""

hope this helps
Mike
 
S

Steven Cheng[MSFT]

Hi Rick,

I think Jeff and Mike's suggestions are reasonable, playing a background
sound is something of the HTML web's capability and in asp.net , we also
make use of that feature. And also, different browsers may have different
html tags or elements to do that. Here is a kb on how to add background
sound in IE:

#How to apply a background sound to a Web page in FrontPage
http://support.microsoft.com/default.aspx?scid=kb;en-us;297477

Hope also helps. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,225
Members
46,815
Latest member
treekmostly22

Latest Threads

Top