When using kAudioUnitSubType_VoiceProcessingIO
combined with AVAudioPlayer
this leads to the audio playback volume being pretty low. When switching to kAudioUnitSubType_RemoteIO
the playback volume is again on a proper high level.
It is depending on the order 3 steps
A
. Configuring the VoiceProcessingIO Audio UnitB
. Creating an audio playerC
. Playing the audio player
The volume differs heavily on the order of these 3 steps.
Here is an example repository (_don't wonder why its called audiokit, its a collection of issues I am having with different audio sdks, and thats a collection repository. But this specific branch does not use AudioKit)
https://github.com/mlostekk/AudioKitSampleRate/tree/issue/outputVolumeNoAudiokit (branch outputVolumeNoAudiokit
)
In our app the regular case is represented by the button VP3
. First setting up our voice processing input callback, then at a later time we create audio players and play them back. But this scenario leads to very low output volume
The order is A -> B -> C
Sidenote
The button VP1
(B -> C -> A
) leads to extremely loud volume.
The button VP2
(B -> A -> C
) leads also to extremely loud volume
The button NoVP1
uses also A -> B -> C
, which is the normal case, but in fact here voice processing is disabled, but we need it.
Does anybody have an explanation why this is behaving like it is. And how to solve the VP3
scenario to have normal / not so low output volume
Note 1
This seems to happen only on newer devices (iphone7 and upward) even though a volume difference is also audible on older devices. The newer once are way more drastic
Note 2
It does not matter if the mode is .spokenAudio
, .default
or .measurement
. It seems to depend on the kAudioUnitSubType_VoiceProcessingIO
only.