views:

612

answers:

5

I am experiencing some strange behavior of embedded audio (wav file) on HTML page. I've got a page https://server.com/listen-to-sound, and a Wav file embedded in it via <EMBED/> tag, like this:

<embed src='https://server.com/path-to-sound' hidden="true" autostart="true" />

The page https://server.com/listen-to-sound is opened in IE 6 SP3 on machine#1 - the sound is played in the headphones. The same page is opened on another machine(#2), with exactly same IE 6 SP3 version, privacy and proxy settings - there's no sound.

Totally, from 6 machines the sound is played on 2 and not played on 4. From these 4 machines, when the page https://server.com/listen-to-sound is opened in Opera, the sound is played.

I've triple-checked headphone connections, volume settings and other possible hardware and software driver issues: the problem is definitely in IE settings.

I've also checked https://server.com/path.to.sound URL - the 4 machnies that do not play sound fail to open this link, failing with an error like "Failed to download page".

Cleaning IE caches, temporary internet files, SSL certificate caches did not solve the problem either.

Googling gave me nothing special but old Flash trick to use <OBJECT> tag and <EMBED> tag to be written in Object's comments.

What have I missed? Have you experienced similar or related problems? How were they solved? Do you have any suggestions on where the trick is? Do you know some IE "features" that might affect execution(playing, showing) of embedded objects?

A: 

I could'nt find any informations on this, but have you tried playing sound from Javascript ? I don't know if it's a viable workaround for you but this might be a solution.
You can find different ways to do it here: http://www.phon.ucl.ac.uk/home/mark/audio/play.htm

Hope that will help you.

netsuo
The problem is that the solution should work without JavaScript, this was given as a requirement.
DiaWorD
A: 

I realise this is offtopic, but I guess worth repeating: please don't put sound on your web pages. I routinely, explicitly block sound coming from web pages (via MediaPlayerConnectivity).

Are your other users doing the same (but perhaps a different method of blocking)?

jamesh
This sound is actually audio captcha. I.e. if a user could not read captcha word from a picture, he/she is allowed to open a page containing this sound, and the user IS warned that new page will contain audio. So, sound is additional functionality and blocking it is user's trouble.
DiaWorD
A: 

In regard to your comment to jamesh, I would advise to provide instead a link to the audio file: some computers (mine at work) have no sound, not everybody is using IE, embed isn't part of HTML (it is a hack supported by various browsers, it isn't defined in HTML 4.01 Transitional DTD for example) and chances are the visiting browser have no plug-in to play your sound.

As your tests show, it is prone to problems...

At worst, provide a <NOEMBED> tag to supply the said link. Or nest various methods, like <object>. At least, Flash is supported by nearly all browsers.

PhiLho
A: 

I think the main reason is acting different on each computer/browser you're using is because it is a non-standard tag.

Getting media to play inside a web page has always been a bit of a pain. You may try something like this:

<object type="audio/x-wav" data="data/test.wav" width="200" height="20">
  <param name="src" value="data/test.wav">
  <param name="autoplay" value="false">
  <param name="autoStart" value="0">
  alt : <a href="data/test.wav">test.wav</a>
</object>

The above was taken from this site explaining how to use the object tag.

T Pops
A: 

I have not found the solution, but I can confirm that the likely problem is the https:. I have found that windows media player does not play files with a full url/src leading to https. However, quicktime will. So, computers with quicktime will successfully play the file back while those with only WMP will fail.

One "solution" is to link to the http: (non-secure) version of the file.

Jason