ryanheise / just_audio

Audio Player
1.03k stars 647 forks source link

[New Section] Supported Audio File Formats #371

Open imcrisanto opened 3 years ago

imcrisanto commented 3 years ago

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.

ryanheise commented 3 years ago

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.

imcrisanto commented 3 years ago

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.

ryanheise commented 3 years ago

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 commented 3 years ago

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?

meghead commented 3 years ago

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

Groseuros commented 3 years ago

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

ronlinet commented 3 years ago

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

ryanheise commented 3 years ago

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?

rafahead commented 2 years ago

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)

ryanheise commented 2 years ago

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

talksik commented 1 year ago

I don't think ogg is supported for macos

ryanheise commented 1 year ago

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