Connecting Tech Pros Worldwide Forums | Help | Site Map

Play a sound

Rick Lederman
Guest
 
Posts: n/a
#1: Nov 19 '05
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



Jeff Evans
Guest
 
Posts: n/a
#2: Nov 19 '05

re: Play a sound


Rick Lederman < rick@soaringsoftware.com > wrote:[color=blue]
> 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?[/color]


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".


vMike
Guest
 
Posts: n/a
#3: Nov 19 '05

re: Play a sound



"Rick Lederman" <rick@soaringsoftware.com> wrote in message
news:%23bG0wqE5EHA.3980@TK2MSFTNGP10.phx.gbl...[color=blue]
> 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
>
>[/color]
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


Steven Cheng[MSFT]
Guest
 
Posts: n/a
#4: Nov 19 '05

re: Play a sound


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...b;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.)

Closed Thread