Skip to content

Fixed issue with ALAC 20-bit files not having PCM format detected#3089

Open
nift4 wants to merge 1 commit intoandroidx:mainfrom
nift4:alac20bit
Open

Fixed issue with ALAC 20-bit files not having PCM format detected#3089
nift4 wants to merge 1 commit intoandroidx:mainfrom
nift4:alac20bit

Conversation

@nift4
Copy link
Contributor

@nift4 nift4 commented Feb 24, 2026

Split from other PR as requested in #3063 (comment), please assign this to @rohitjoins. Thanks!

--

  • after Parse ALAC bit depth from initialization data #2738 common alac files had bit depth populated correctly, but I recently learnt that there is also 20-bit alac files (you can create them with afconvert). it doesn't make any sense and it's very complex to handle 20-bit PCM in the media3 pipelines because one byte may belong to multiple samples, but we also don't need to. create an encoding used to flag that this file is 20-bit PCM in the ALAC Format object, but expect decoders to output 24-bit or 16-bit PCM instead (playback will otherwise fail). (test file created from other test files in this repo included.)

- after androidx#2738 common alac files
  had bit depth populated correctly, but I recently learnt that there
  is also 20-bit alac files (you can create them with afconvert).
  it doesn't make any sense and it's very complex to handle 20-bit
  PCM in the media3 pipelines because one byte may belong to multiple
  samples, but we also don't need to. create an encoding used to flag
  that this file is 20-bit PCM in the ALAC Format object, but expect
  decoders to output 24-bit or 16-bit PCM instead (playback will
  otherwise fail).
  (test file created from other test files in this repo included.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants