Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Play a sound

Reply
Thread Tools

Play a sound

 
 
Rick Lederman
Guest
Posts: n/a
 
      12-17-2004
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


 
Reply With Quote
 
 
 
 
Jeff Evans
Guest
Posts: n/a
 
      12-17-2004
Rick Lederman < http://www.velocityreviews.com/forums/(E-Mail Removed) > wrote:
> 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".


 
Reply With Quote
 
 
 
 
vMike
Guest
Posts: n/a
 
      12-17-2004

"Rick Lederman" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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


 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      12-20-2004
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.)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
To play or not to play bhuckle@bigpond.net.au DVD Video 1 08-01-2007 07:18 AM
PLAY MORE VIDEO GAMES WITH GOTTA PLAY Paul Heslop Digital Photography 0 05-21-2007 11:40 AM
How to beep or play any sound? YeeCN ASP .Net 1 05-13-2004 08:14 AM
Mozilla could not play sound file attached to BlueMountain Card Art Hough Firefox 1 11-07-2003 11:41 PM



Advertisments