I have following code base
Audiosource.onloadeddata = function () {
$("#txtAudioDuration").val(Math.round(Audiosource.duration));
};
When I use .mp3,.mp4,.ogg,.wav audio duration is populated correctly, but when I use mpg or mpeg audio file, the duration is not being loaded.
I have tried with converted mpg and mpeg audio file, I don't have original mpg or mpeg audio files. Is there any link to download these files.
Any suggestion would be highly appreciated.
Thanks
MPG files are also listed as MPEG-1 and MPEG-2 files. Both types of MPG files serve as container files for audio and video data to ensure the two portions remain in sync. Windows, Mac, and many mobile devices can run MPEG-1 and MPEG-2 files.
MPEG Compression The name MPEG stands for Moving Pictures Experts Group. MPEG is a tool for video compression, which involves the compression of images and sounds, as well as synchronization of the two.
An MPG file is a common video file that uses a digital video format standardized by the Moving Picture Experts Group (MPEG). It stores video, audio, and metadata interleaved together. MPG files are often used for creating movies that are distributed on the Internet.
mpeg (or . mpg) file extension is an MPEG video file format, which is a popular format for movies that are distributed on the internet. They use a specific type of compression that makes streaming and downloading much quicker than other popular video formats. RELATED: What Is A File Extension?
First thought was you need to set server content-type headers audio/mpeg
instead of video/mpeg
. I tried to configure my nginx
properly, but audio tag still doesn't work.
You can't do that, browsers don't support mpeg
type.
Firefox supports Ogg Vorbis and WAV
Opera supports Ogg Vorbis and WAV
Safari supports MP3, AAC, and MP4
Chrome supports Ogg Vorbis, MP3, WAV, AAC, and MP4
Internet Explorer 9+ supports MP3, AAC, and MP4
iOS supports MP3, AAC, and MP4
Android supports AAC and MP3
Actually, it can be an old doc, so look here. But even wiki says, that mpeg
is not supported by any browser.
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