i have tried below code but not working ? does anyone play amr files in website
<audio id="audio" src="upload/hello2.amr"
preload="auto" controls muted loop autoplay>
</audio>
any plugin or player which can play amr file in web
AMR file is not one of the supported audio files that html5 audio tag supports. Please see the list below for supported audio formats:
http://en.wikipedia.org/wiki/HTML5_Audio#Supported_audio_coding_formats
I would recommend you convert your amr file to mp3 or ogg and then upload it and play it on your server.
original answer:
Your code specifies an mp3 file. Are you sure you put in the amr file?
Related
The audio player shows up but the audio won't play.
The audio file is in the same folder as the HTML file...
<audio controls>
<source src="audioFileName.ogg" type="audio/ogg">
Audio element not supported by your browser.
</audio>
What's wrong with the code?
I've tried mp3 as well with no luck.
I've also tried it with an mp3 audio file (same folder as well) and the code works, so most likely the problem is with the audio file itself. Maybe your navigator doesn't support it, or the name of the file is slightly wrong.
Here is a MOV video file URL which was copied from my iPhone 8.
https://www.yangfamily.tw/attachments/IMG_3049.MOV
Then I tried to play this video on Chrome, the html code like below:
<video width="320" height="240" controls>
<source src="https://www.yangfamily.tw/attachments/IMG_3049.MOV">
Your browser does not support the video tag.
</video>
Ok, it was loaded successfully.
But no frame showed, only the controls displayed.
And then I right clicked the controls, the menu showed that it is an AUDIO file, not a video file.
It's indeed a video file, and I can play this video file and show the frames successfully on any other player.
Why this MOV video file was read as an audio file in Google Chrome? (Chrome Version: 90.0.4430.93 64-bits)
Any idea?
This video is encoded as h.265 HEVC.
ffprobe is a free open source tool (online version: https://ffprobe.a.video/probe?url=https%3A%2F%2Fwww.yangfamily.tw%2Fattachments%2FIMG_3049.MOV)
when I look at the codec:
codec_long_name : H.265 / HEVC (High Efficiency Video Coding)
h265 is only supported in Safari. its a patent/royalty thing. You should re-encode the video as h264 - and serve that version (99.9% browser support).
Chrome CAN play the audio track:
codec_long_name : AAC (Advanced Audio Coding)
so thats why you get audio only in Chrome.
In your <source> tag, you need to add type='video/mp4'
Like this:
<source src="https://www.yangfamily.tw/attachments/IMG_3049.MOV" type='video/mp4'>
How to play local audio file (c:\classical\chopin.wav - no file selection) in Google Chrome using HTML5 coding?
I'm not on a Windows machine right now. But you should try
<audio src="file:///C:/classical/chopin.wav" controls ></audio>
Of course, this only works, if the webpage is viewed locally on your machine.
Keep your audio file in html folder and this code will work.
<audio controls>
<source src="chopin.wav" type="audio/wav">
Your browser does not support the audio element.
</audio>
I want to insert an audio file in my web page. I have the .mp3, but not the .ogg, so my audio won't play. What can I do to insert that file?
I have the following code:
<audio controls autoplay>
<source src="Viva-la-vida.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
Please correct me if I said something wrong. Thank you in advance!
The code you mentioned is working great with .mp3 file. You can do two things.
Check the path you specified in the src attribute for the .mp3 file.
Run your .html file in different browsers.
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:
WebM
Ogg
MP3
AAC
WAV
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.