Skip to content

Allow to use float output in any case if output provider doesn't support 16-bit int#3104

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

Allow to use float output in any case if output provider doesn't support 16-bit int#3104
nift4 wants to merge 1 commit intoandroidx:mainfrom
nift4:floatfallback

Conversation

@nift4
Copy link
Contributor

@nift4 nift4 commented Mar 5, 2026

This commit is a continuation of 4f4ad5f and fe4f235 by Toni, decoupling DefaultAudioSink logic from assumptions that AudioTrack is used.

  • If audio output provider doesn't support 16-bit int PCM, we should use float PCM in any case, even if input isn't high-resolution PCM
  • Unlike when this check was written, ToFloatPcmAudioProcessor now supports every linear PCM format, similar to ToIntPcmAudioProcessor, it is no longer limited to high-resolution only
  • While AudioTrack (and by extension AudioTrackAudioOutputProvider) always supports 16-bit int (hence, this change is a no-op for them), it may not apply to other ways of outputting PCM
  • Additionally, the same applies to the provider possibly not supporting float PCM output. Currently, we have the enableFloatOutput option, but this is scheduled to be replaced by a more generic one. While we're here, we can address it as well by adding a check.

support 16-bit int

This commit is a continuation of 4f4ad5f
and fe4f235 by Toni, decoupling
DefaultAudioSink logic from assumptions that AudioTrack is used.

* If audio output provider doesn't support 16-bit int PCM, we
  should use float PCM in any case, even if input isn't
  high-resolution PCM
* Unlike when this check was written, ToFloatPcmAudioProcessor now
  supports every linear PCM format, similar to ToIntPcmAudioProcessor,
  it is no longer limited to high-resolution only
* While AudioTrack (and by extension AudioTrackAudioOutputProvider)
  always supports 16-bit int (hence, this change is a no-op for
  them), it may not apply to other ways of outputting PCM
* Additionally, the same applies to the provider possibly not
  supporting float PCM output. Currently, we have the
  enableFloatOutput option, but this is scheduled to be replaced
  by a more generic one. While we're here, we can address it as
  well by adding a check.
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.

1 participant