Configure MediaCodec in API 32+ to always output 99 channels
Configure MediaCodec in API 32+ to always output 99 channels so that we use the audio is spatialized, if the platform can apply spatialization to it. In a follow-up change, the output channel count will be set based on the device's spatialization capabilities. PiperOrigin-RevId: 414751543
This commit is contained in:
parent
341bb57498
commit
87510592bb
@ -795,6 +795,14 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media
|
||||
== AudioSink.SINK_FORMAT_SUPPORTED_DIRECTLY) {
|
||||
mediaFormat.setInteger(MediaFormat.KEY_PCM_ENCODING, AudioFormat.ENCODING_PCM_FLOAT);
|
||||
}
|
||||
|
||||
if (Util.SDK_INT >= 32) {
|
||||
// Disable down-mixing in the decoder (for decoders that read the max-output-channel-count
|
||||
// key).
|
||||
// TODO[b/190759307]: Update key to use MediaFormat.KEY_MAX_OUTPUT_CHANNEL_COUNT once the
|
||||
// compile SDK target is set to 32.
|
||||
mediaFormat.setInteger("max-output-channel-count", 99);
|
||||
}
|
||||
return mediaFormat;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user