Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Nov 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Sound coding works only until loaded

    I created a webpage, and I wanted to add the sound of underwater bubbles. After many hours researching the coding and converting a wave file to an ogg file, I was able to make it work on my computer, but when I uploaded to the FTP server, there was no sound. I used this code for the sound:
    Code:
    <object classid="Water bubbling.ogg" codetype="audio/ogg Standby="" Title="Darca's Birthday">
    <object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6:Water bubbling.class" codetype="audio/wav" width=2 height=0 standby="" Title="Darca's Birthday">
    <OBJECT DATA="Water bubbling.ogg" type="audio/ogg" title="Darca's Birthday" width=2 height=0>
    <param name="autostart" value="true" >
    <param name="src" value=Water bubbling.ogg" >
    <param name="autoplay" value="true >
    <param name="hidden" value="true">
    <embed src="Water bubbling.ogg" hidden="true" loop="true" autoplay="true" autostart="true" type="audio/x-wav" />
    <noembed>audio sounds</noembed>
    </object>
    </object>
    </object>
    Here's the link for page -- I really want this to work -- it would be so cool.
    http://www.palmpainter.info/darca3/index.htm

    Do I need more code? Is this something that maybe my webhosting provider needs to fix?

    Thanks for your help.
    a10sgoddess


  • #2
    Regular Coder
    Join Date
    May 2010
    Location
    Bathurst, Australia
    Posts
    180
    Thanks
    1
    Thanked 22 Times in 22 Posts
    I haven't actually done any audio stuff before but i have a few ideas. For starters you said it's an ogg file? I have no idea what that is, does it need to be an ogg? But given you've used this file is codetype=audio/wav right? Have you double checked that's what's needed and its not trying to find a .wav. Also chrome asks me to install a quicktime plug-in where as IE does not. Could be IE doesn't support what you're trying to do, and i'm guessing most browsers need a plugin. Maybe because you already have quicktime it works client side but not from the server or something? I dunno, maybe that will help in finding your answer. But on a side note you need to do something about your fishies. Do they have fixed positioning on them or something? They move with the rest of the page and get all glitchy.


    Edit:
    I say or something a lot...

  • #3
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,300
    Thanks
    28
    Thanked 275 Times in 269 Posts
    Here's some revised code that uses the HTML5 audio element with an HTML object element as fallback. The code works for me in Mozilla Firefox 4.0 Beta 7, Google Chrome 9.0 (Dev Channel), and Opera 10.6. (The version of Firefox I'm using seems to have some bugs; when using the object element only, the music inexplicably stops playing after a few seconds and the fallback content of the element is improperly displayed even though the audio content is successfully loaded.)

    The code doesn't work in Windows Internet Explorer 9 Platform Preview 6 (or is it 7?) or Safari 5. I'm not certain exactly what they support in terms of the object element, but it seems that WIE9 supports MP3/AAC and Safari supports whatever QuickTime supports (e.g., MP4) for the audio element. (Both Apple and Microsoft have a financial stake in the formats they're pushing which explains both that and the fact that they don't support the free format (Ogg Vorbis).)

    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <html xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
    	<head>
    		<title>Demo</title>
    	</head>
    	<body>
    		<audio controls="controls" loop="loop" autoplay="autoplay" src="Epoq-Lepidoptera.ogg">
    			<object type="audio/ogg" data="Epoq-Lepidoptera.ogg">
    				<p>Your Web browser does not support playback of Ogg Vorbis audio files. You can <a href="Epoq-Lepidoptera.ogg">download this audio file</a> instead.</p>
    			</object>
    		</audio>
    	</body>
    </html>
    The audio file used can be located at http://www.vorbis.com/music/. It's just a random free file.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #4
    New to the CF scene
    Join Date
    Nov 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Thanks!

    Thanks so much for your reply. I didn't see it before. I think I'm going to just try the wav file. I tried the link, but I couldn't open the ogx file. I will definitely your advice in my memory banks! Thanks so much.
    Jann


  •  

    Posting Permissions

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