7

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 Unit
  • B. Creating an audio player
  • C. 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.

Martin Mlostek
  • 2,755
  • 1
  • 28
  • 57
  • did you find a solution for this? are you trying to mix audio from audiounit and avaudioplayer? Have you considered using the mixer audio unit? – zakishaheen Jan 08 '21 at 00:25
  • We well, kind of. I measure the gai. Of the avaudio session before and after activating it, the apply a gain to the playback buffers to compensate that ratio. – Martin Mlostek Jan 09 '21 at 20:53
  • @MartinMlostek could you pls tell me 1. how did you measured gain of audio session? 2. how did you apply gain to playback buffers? Thank you for your answers – Paul Nadolinskyi Jun 30 '21 at 21:11

0 Answers0