html5 audio tag not working in IE11 and Edge - html

I'm new to this forum and have looked at some previous answers, but can't find any that help.
I thought html5 audio was supposed to be simple?? i can't get it to work in either IE11 or Edge:
<audio controls autoplay>
<source src="music/Aranjuez.ogg" type="audio/mpeg">
<source src="music/Aranjuez.mp3" type="audio/ogg">
Your browser does not support the audio element
</audio>
What am I doing wrong?

You mixed up the file types:
<source src="music/Aranjuez.ogg" type="audio/mpeg">
<source src="music/Aranjuez.mp3" type="audio/ogg">
should be
<source src="music/Aranjuez.ogg" type="audio/ogg">
<source src="music/Aranjuez.mp3" type="audio/mp3">

Related

Why Audio Autoplay Attribute doesn't work?

<audio controls autoplay loop >
<source src="media/Will.Smith-ft-Ludacris-Party.Starter.mp3" type="audio/mpeg">
<source src="media/Will.Smith-ft-Ludacris-Party.Starter.aac" type="audio/aac">
<source src="media/Will.Smith-ft-Ludacris-Party.Starter.oga" type="audio/ogg">
Youre Browser Dose Not Support Audio Tag
</audio>
I'm trying with IE, Chrome, Firefox but doesn't work.
what is wrong?

In HTML5 audio player play more than one audio

I am working with HTML5 audio. I have a question. Is it possible to play more than one audio on the same page, same time using HTML5 audio player ?
yes it's possible with multiple <audio> tags for example
<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
</audio>
<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
</audio>

how to remove black background of audio player in html

I embedded an audio on my web page with <embed> but there is a black background behind the player.
Why does this happen and how should I remove it? Or is there any other better way to embed the audio?
[<embed src="../audio/introduction.mp3" autostart="true" loop="true" bgcolor="" >]
This is how the audio player looks like:
https://i.stack.imgur.com/Ktr1P.png
If you are using HTML5 then <audio> tag is the best choice for you:
https://www.w3schools.com/tags/tag_audio.asp
<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
We can use HTML5 Audio tag for this purpose instead of embed
<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>

HTML audio won't play file but download works

I feel like I have tried everything.
I have the following:
<audio controls ng-src="https://myS3routeToFile" class="w-full"></audio>
I have also tried the following variation:
<audio controls>
<source src="https://myS3routeToFile" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
I am able to press download it does download the file correctly.
What am I doing wrong?
Use the second version and add an ogg version of your audio file to make it complatble with all browsers.
<audio controls>
<source src="your_file.ogg" type="audio/ogg">
<source src="your_file.mp3" type="audio/mpeg">
</audio>

Automatically play audio in HTML 5

I have music I want to play and loop on the web page startup. Here's my code:
<audio autoplay="autoplay" loop controls="controls">
<source src="music.mp3" />
</audio>
The question that is a "duplicate" does not suit my needs and does not work for me.
I found out what to do using a div with the visibility to hidden
<div style="visibility:hidden">
<audio controls autoplay loop>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
</div>