Use different scopes on the output bus depending on AudioUnit type

This commit is contained in:
Andreas Pehrson 2024-08-07 09:35:54 +02:00 коммит произвёл Chun-Min Chang
Родитель 0f642c8d50
Коммит 4a2ef4684f
1 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -3786,7 +3786,16 @@ impl<'ctx> CoreStreamData<'ctx> {
let r = audio_unit_get_property(
self.output_unit,
kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Input,
if using_voice_processing_unit {
// With a VPIO unit the output scope includes all channels in the hw.
// The VPIO unit however is only MONO which the input scope reflects.
kAudioUnitScope_Input
} else {
// With a HAL unit the output scope for the output bus returns the number of
// output channels of the hw, as we want. The input scope seems limited to
// two channels.
kAudioUnitScope_Output
},
AU_OUT_BUS,
&mut output_hw_desc,
&mut size,