I am recording audio in different mobiles and each saves the file in different format like
.m4a, .3ga, .amr
. The problem now I am facing is how to play such audio files in any browser.
<audio controls height="100" width="100">
<source src="myfile.mp3" type="audio/mpeg">
<source src="myfile.ogg" type="audio/ogg">
<embed height="50" width="100" src="myfile.mp3">
</audio>
I tried the above code, but not useful. because I am unable to apply the code for .m4a, .3ga and .amr.
Phone recordings wont be in mp3 files for sure
Any other approach I need to apply ?
Any suggestions ? Please
I'm sorry to bring you the bad news, but you can't play any file format in a <audio>
HTML5 element.
Instead, you can choose from a list of valid audio formats as listed here:
https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats
Shortly, the valid formats are:
In your case, if you would like to play any audio format that isn't supported by the HTML5 spec, you will have to solve it, the same way audio files were played before HTML5, by using Plugins.
You can find on the web lots of audio-plugins for the browser, for each type of file format.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With