Play a sound

Discussion in 'ASP .Net' started by Rick Lederman, Dec 17, 2004.

  1. 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
    Rick Lederman, Dec 17, 2004
    #1
    1. Advertising

  2. Rick Lederman

    Jeff Evans Guest

    Rick Lederman < > 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".
    Jeff Evans, Dec 17, 2004
    #2
    1. Advertising

  3. Rick Lederman

    vMike Guest

    "Rick Lederman" <> wrote in message
    news:%...
    > 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
    vMike, Dec 17, 2004
    #3
  4. 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.)
    Steven Cheng[MSFT], Dec 20, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. YeeCN

    How to beep or play any sound?

    YeeCN, May 10, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    536
    Guest
    May 13, 2004
  2. Lord2702

    How to play sound

    Lord2702, Oct 4, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    581
    =?Utf-8?B?c3Jpbmk=?=
    Oct 4, 2004
  3. Lam

    play sound file

    Lam, Mar 3, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    817
    Steve C. Orr [MVP, MCSD]
    Mar 3, 2005
  4. Giuliano Pascali

    IE don't play the sound

    Giuliano Pascali, Sep 18, 2003, in forum: Java
    Replies:
    0
    Views:
    418
    Giuliano Pascali
    Sep 18, 2003
  5. Chris Ianson
    Replies:
    44
    Views:
    7,128
    Neredbojias
    Mar 19, 2006
Loading...

Share This Page