NiftyHost Forums (Archive)
invisible sound on webpage? - Printable Version

+- NiftyHost Forums (Archive) (https://niftyhost.chary.us/support)
+-- Forum: Discussion (https://niftyhost.chary.us/support/forum-20.html)
+--- Forum: General (https://niftyhost.chary.us/support/forum-11.html)
+--- Thread: invisible sound on webpage? (/thread-461.html)



invisible sound on webpage? - CrazySp4ce - 08-06-2010

any1 no the html code for invisible sound on webpage?


RE: invisible sound on webpage? - RichardGv - 08-06-2010

There are several ways to achieve the effect, I believe:
  1. A hidden < audio > tag will probably work, but since it's a HTML5 tag, the cross-browser compatibility is not so great right now.
    Code:
    IE 6/7/8                No support
    Firefox 3.5.x - 3.6.x   wav, ogg
    Safari                  "Safari on the desktop supports any media the installed version of QuickTime can play", they said, thus H.264, MP3, AAC, and WAV should work, but ogg may not work.
    Chromium/Chrome         ogg, wav, mp3, aac
    Opera                   ogg, wav (On Linux, Opera supports the formats GStreamer does)
    The detailed methods can be found on Google, or some links given here:
    http://net.tutsplus.com/tutorials/html-css-techniques/quick-tip-the-html-5-audio-element/
    http://dev.opera.com/articles/view/everything-you-need-to-know-about-html5-video-and-audio/
    http://developer.apple.com/safari/library/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/AudioandVideoTagBasics/AudioandVideoTagBasics.html
  2. Flash. It works on most cases, provided that the user did not intentionally block Flash, and does have Flash installed. There are a lot of Flash audio players available, for instance: (Keep in mind that I cannot guarantee these things are safe!)
    http://www.longtailvideo.com/players/jw-flv-player/
    http://musicplayer.sourceforge.net/
    http://flowplayer.org/
    (And you can hide a Flash player easily.)
  3. There are also cases of video relying on other plugins, e.g. Windows Media Plugin. Of course, this is usually a bad idea.
Last but not least, it's usually not a good idea to play audio automatically on a webpage without a way to let user stop it manually. :) And playing music in the background is annoying in viewpoints of some people, like me.


RE: invisible sound on webpage? - khy - 08-06-2010

me too
as I'm listening my own music in my mp3 player


RE: invisible sound on webpage? - Vanilla - 08-06-2010

IE9 will support it, but only play MP3 and AAC, not WAV, which is weird, as it's a Microsoft-IBM developed format.

By the way, you can stack multiple sources inside the audio tag, so that if one format is incompatible, it will automatically go on to the next format, and play it if possible:

Code:
<audio controls autobuffer>
  <source src="elvis.ogg" />
  <source src="elvis.mp3" />
  <!-- now include flash fall back -->
</audio>



RE: invisible sound on webpage? - HiddenKnowledge - 08-07-2010

(08-06-2010, 11:02 AM)RichardGv Wrote: Last but not least, it's usually not a good idea to play audio automatically on a webpage without a way to let user stop it manually. :) And playing music in the background is annoying in viewpoints of some people, like me.

Seriously, a lot of people are browsing the internet at night while the rest of the people are asleep, autoplaying is annoying, autoplaying + hidden is awful!


RE: invisible sound on webpage? - CrazySp4ce - 08-07-2010

(08-06-2010, 11:23 PM)Vanilla Wrote: IE9 will support it, but only play MP3 and AAC, not WAV, which is weird, as it's a Microsoft-IBM developed format.

By the way, you can stack multiple sources inside the audio tag, so that if one format is incompatible, it will automatically go on to the next format, and play it if possible:

Code:
<audio controls autobuffer>
  <source src="elvis.ogg" />
  <source src="elvis.mp3" />
  <!-- now include flash fall back -->
</audio>

Thanks all for the help butt this 1 works
(08-07-2010, 03:21 AM)HiddenKnowledge Wrote:
(08-06-2010, 11:02 AM)RichardGv Wrote: Last but not least, it's usually not a good idea to play audio automatically on a webpage without a way to let user stop it manually. :) And playing music in the background is annoying in viewpoints of some people, like me.

Seriously, a lot of people are browsing the internet at night while the rest of the people are asleep, autoplaying is annoying, autoplaying + hidden is awful!

u really think that hk i was thinking on like a 20 second intro thingy


RE: invisible sound on webpage? - HiddenKnowledge - 08-08-2010

(08-07-2010, 10:52 PM)CrazySp4ce Wrote:
(08-07-2010, 03:21 AM)HiddenKnowledge Wrote:
(08-06-2010, 11:02 AM)RichardGv Wrote: Last but not least, it's usually not a good idea to play audio automatically on a webpage without a way to let user stop it manually. :) And playing music in the background is annoying in viewpoints of some people, like me.

Seriously, a lot of people are browsing the internet at night while the rest of the people are asleep, autoplaying is annoying, autoplaying + hidden is awful!

u really think that hk i was thinking on like a 20 second intro thingy
Yes, I will kill you if you don't allow people to shut it off. :P