Hello,
I'm developing a speech recognition app with Unity 6000.0.58f2. The app also has
other content besides speech recognition, so I switch the AVAudioSession only when
the user needs to speak, and restore it once recording is no longer needed.
On iPhone Air (iOS 26), I'm seeing the following issues:
While the session is set to PlayAndRecord with VoiceChat mode, playback volume
is consistently lower than normal.
After restoring the session to SoloAmbient, playback volume stays low for a few
seconds before returning to normal.
I'd like to avoid this volume drop. Any advice or recommended approach would be
greatly appreciated.
[Implementation]
I use a native iOS plugin (.mm file) called from Unity.
When the user starts speaking, I enable recording with:
success = [session setCategory:AVAudioSessionCategoryPlayAndRecord
mode:AVAudioSessionModeVoiceChat
options:AVAudioSessionCategoryOptionDefaultToSpeaker |
AVAudioSessionCategoryOptionAllowBluetooth
error:&error];After speaking ends, I restore the session with:
success = [session setCategory:AVAudioSessionCategorySoloAmbient error:&error];
success = [session setMode:AVAudioSessionModeDefault error:&error];[Environment]
Device: iPhone Air
iOS: 26.[x]
Unity: 6000.0.58f2
Reproduces on other devices / iOS versions: [Yes / No — e.g. iPhone 15 (iOS 18.x) does not reproduce]
Output route: built-in speaker [/ Bluetooth: ___ ]
[Questions]
Is the lower playback volume in VoiceChat mode expected behavior due to voice
processing (echo cancellation / ducking)? If so, is there a recommended way to
keep playback volume at a normal level while recording for speech recognition
(e.g. using a different mode such as Default or Measurement, or adjusting
voice processing ducking)?
What is the recommended sequence for restoring the session so that playback
volume returns to normal immediately? For example, should I call
setActive:NO (with NotifyOthersOnDeactivation) before changing the category,
or set the category and mode together in a single call?
Is there any behavior change in iOS 26 or anything specific to iPhone Air
that could cause this?
Thank you in advance.
Topic:
Media Technologies
SubTopic:
Audio
0
0
169