SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Jul 2002
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Playing sounds with Javascript?

    What is the best way to add sounds (that play once at a certain time) to a dynamic page? Some methods I notice don't work on Macintosh, this is a problem since I use a Mac. Thanks in advance for your help!
    "Is life not a hundred times too
    short for us to stifle ourselves?"

  2. #2
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  3. #3
    SitePoint Member
    Join Date
    Jul 2002
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I copied and pasted the code onto a HTML page and uploaded it to my server but it did not seem to do anything...
    "Is life not a hundred times too
    short for us to stifle ourselves?"

  4. #4
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    is use this if it helps

    Take a look here
    Its a previous post about the same thing.
    I only know it works for IE, but it is a good one as it lets you control multiple sounds.

    I hope it helps
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if

  5. #5
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    how is that code?

    Its the second time I've answered this question, and there's been no feedback.
    If anyone has tried this sound function can they let me know if it works for other browsers.

    Many thanks.
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if

  6. #6
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The <embed> version works in IE6*, in Mozilla 1.2* you can use the <object> version (only tested autostart=true, does anyone know how to play the sound for example on onclick for a button?), in Opera 7* the autotart=false is ignored

    (*Windows)

  7. #7
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    embed cross browser

    here's a code that lets you work with windows media player cross browser......

    http://msdn.microsoft.com/downloads/...ed/default.asp

    I dont know how well it works, just found it and I only have IE installed.
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •