Jump to content

Adding audio to a web page


crmamx

Recommended Posts

The html5 embed tags are what I have been trying to use...with different options. Can't get any of them to work on the server.

 

My pc files and server files have identical names. I have tried mp3, midi and wav files and I am positive they exist on the server.

 

As a side note my video files play ok.

do you have an online example of your code that is not working?

I am not a fan of w3schools but since they have an example with a horse i must link to it :P

http://www.w3schools.com/html5/tag_audio.asp

Also the browser must be ready for it

 

do you have an online example of your code that is not working?

I am not a fan of w3schools but since they have an example with a horse i must link to it :P

http://www.w3schools.com/html5/tag_audio.asp

Also the browser must be ready for it

 

Here is what  works on the PC.

<object>
<param name="autostart" value="true">
<param name="src" value="Orange_Blossom_Special.mp3">
<param name="autoplay" value="true">
<param name="controller" value="true">
<embed src="Orange_Blossom_Special.mp3" controller="true" autoplay="true" autostart="True" type="audio/wav" />
</object> 

 

This works on the PC where the html and audio are in the same file. Note that type=audio/wav. If I change that to mp3 it will not work.

 

Here is the code I have uploaded to the server and it will not work.

<object>
<param name="autostart" value="true">
<param name="src" value="Orange_Blossom_Special.mp3">
<param name="autoplay" value="true">
<param name="controller" value="true">
<embed src="public_html/Web_Page_Files/Sound/Orange_Blossom_Special.mp3" controller="true" autoplay="true" autostart="True" type="audio/wav" />
</object> 

 

I have tried every variation of the embed src= that there is including putting the audio in the same folder as the program but I can't get it to work.

  • 4 weeks later...

remove public_html/ from the src.

 

Also Web Page Files. Finally, this works:

 

<object>
<param name="autostart" value="true">
<param name="src" value="Orange_Blossom_Special.mp3">
<param name="autoplay" value="true">
<param name="controller" value="true">
<embed src="/sound/Orange_Blossom_Special.mp3" controller="true" autoplay="true" autostart="True" type="audio/wav" />
</object> 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.