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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 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> 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.