just_audio icon indicating copy to clipboard operation
just_audio copied to clipboard

[New Section] Supported Audio File Formats

Open imcrisanto opened this issue 3 years ago • 10 comments

To which pages does your suggestion apply?

Describe your suggestion This section will help new or novice users understand what files they can support in their app across different platforms. This section would be community supported through testing and updated to reflect any known issues that arise. This list would be sorted by popularity and updated and tested regularly. Here is a sample of how the section would look like.

Supported Audio File Formats (Community Tested)

File Format Android iOS macOS Web
.mp3
.wav
.m4a
.m4b
.aac
.flac
.3gp
.aiff
.alac
.amr
.webm
.ogg

This list is subject to constant change please consider reporting any bugs you encounter here

Contributions

I have not created a pull request yet as testing all of these formats will take a considerable amount of time and I would like to solicit the help of the community to help test and verify these formats before I propose any changes. Please comment on what formats you have tested for the latest package release of just_audio.

FORMAT: File Format .xxx tested on Android, iOS, macOS, Web all tests [succeeded/failed]

I have currently verified that mp3 and wav works across all platforms and also noted in Issue #369 that ogg files are not supported natively on iOS.

I will close this issue after a pull request has been made or if there is no interest from the community.

imcrisanto avatar Apr 08 '21 04:04 imcrisanto

I wrote a reply earlier and lost it, but was going to say this is a good idea. Maybe it would be best as a wiki page and then the README could link to that.

Or perhaps it would also work to link to an official page from Apple and Android listing the supported codecs. Here is the Android list:

https://exoplayer.dev/supported-formats.html

I wasn't able to find the Apple one just now but I'm sure I have come across it before.

ryanheise avatar Apr 08 '21 15:04 ryanheise

I was able to find the Apple one here but it's pretty old (but I think still accurate)

https://developer.apple.com/library/archive/documentation/MusicAudio/Conceptual/CoreAudioOverview/SupportedAudioFormatsMacOSX/SupportedAudioFormatsMacOSX.html

I agree with you that it would be good to optionally list relevant links such as the compatibility chart listed on the HTML5 audio Wikipedia page

https://en.wikipedia.org/wiki/HTML5_audio

I still think we should place the table with the most common audio formats as a quick guide. Perhaps we could add a disclaimer as well that there are no guarantees and if they encounter a problem they can submit a pull request to the table.

imcrisanto avatar Apr 09 '21 05:04 imcrisanto

I have opened the Wiki to edits so please feel welcome to create a page for codec support. For the README, my preference is to have a simple link to that wikipedia page as that way we won't need to keep releasing new versions of just_audio just to make updates to the list.

ryanheise avatar Apr 09 '21 08:04 ryanheise

I just realised the wiki wasn't actually open, but hopefully that is fixed now. I have created a wiki page for supported audio formats:

https://github.com/ryanheise/just_audio/wiki/Supported-audio-formats

Can you try copying and pasting your table into that wiki page and see if access permits it?

ryanheise avatar Apr 15 '21 07:04 ryanheise

.m4a doesn't seem to work for me. mp3 is ok. I thought these were more or less the same?

meghead avatar May 18 '21 07:05 meghead

From URL:

.aac works fine on both Android & iOS

Edit:

Seeking / Progress bar doesn't work on Android for .aac files

.m4a works fine on Android w/ seeking / progress bar but doesn't work on iOS

.webm works fine on Android w/ seeking / progress bar but doesn't work on iOS

.ogg works fine on Android w/ seeking / progress bar but doesn't work on iOS

Groseuros avatar Jun 14 '21 22:06 Groseuros

.mp3 is ok, .m4a doesn't work on IOS I haven't tested Android,

ronlinet avatar Jun 17 '21 11:06 ronlinet

When testing different formats, it's also important to eliminate any other reasons why audio might not be playing on iOS. For example, if playing from a URL, the HTTP headers must meet Apple's requirements: it must have the correct content-type, content-length and support byte range requests.

From memory, m4a works on iOS for me. Do you have a URL of an .m4a that doesn't work as a counter-example?

ryanheise avatar Jun 18 '21 01:06 ryanheise

I was able to play mp4a format on the web. I used this link as a reference: (https://github.com/ryanheise/just_audio/issues/187#issuecomment-787423071)

rafahead avatar Dec 23 '21 12:12 rafahead

I am guessing that "mp4a" is the same as m4a?

ryanheise avatar Dec 24 '21 07:12 ryanheise

I don't think ogg is supported for macos

talksik avatar Nov 03 '22 12:11 talksik

FYI there is also a question on StackOverflow that gives an answer by referencing other sources for iOS and Android.

ryanheise avatar Nov 03 '22 13:11 ryanheise