Skip to content

Commit

Permalink
Use different scopes on the input bus depending on AudioUnit type
Browse files Browse the repository at this point in the history
  • Loading branch information
Pehrsons authored and padenot committed Jun 17, 2024
1 parent 9ea3d34 commit b5dc6e2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3572,7 +3572,15 @@ impl<'ctx> CoreStreamData<'ctx> {
let r = audio_unit_get_property(
self.input_unit,
kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Output,
if using_voice_processing_unit {
// With a VPIO unit the input scope includes AEC reference channels.
// We need to use the output scope of the input bus.
kAudioUnitScope_Output
} else {
// With a HAL unit the output scope for the input bus returns the number of
// output channels of the output device, i.e. it seems the bus is ignored.
kAudioUnitScope_Input
},
AU_IN_BUS,
&mut input_hw_desc,
&mut size,
Expand Down

0 comments on commit b5dc6e2

Please sign in to comment.