Skip to content

Commit c74e829

Browse files
committed
Use different scopes on the output bus depending on AudioUnit type
1 parent e143e87 commit c74e829

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/backend/mod.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -3783,7 +3783,16 @@ impl<'ctx> CoreStreamData<'ctx> {
37833783
let r = audio_unit_get_property(
37843784
self.output_unit,
37853785
kAudioUnitProperty_StreamFormat,
3786-
kAudioUnitScope_Input,
3786+
if using_voice_processing_unit {
3787+
// With a VPIO unit the output scope includes all channels in the hw.
3788+
// The VPIO unit however is only MONO which the input scope reflects.
3789+
kAudioUnitScope_Input
3790+
} else {
3791+
// With a HAL unit the output scope for the output bus returns the number of
3792+
// output channels of the hw, as we want. The input scope seems limited to
3793+
// two channels.
3794+
kAudioUnitScope_Output
3795+
},
37873796
AU_OUT_BUS,
37883797
&mut output_hw_desc,
37893798
&mut size,

0 commit comments

Comments
 (0)