I'm using this plugin alongside just_audio and audio_session plugins in my app.
Because my players have to support audio route switching, I am using the audio_session plugin for it.
With this setup, I ran into the following issues when recording on iOS:
sometimes the first 1-2 seconds of a recording is being truncated
notifications of route changes stopped working
The reason for this is that AudioRecorder.start() also configures the shared AVAudioSession and activates it,
after I already have configured and activated it through audio_session.
This re-activation can cause a delay in audio processing when recording and also explains the cancelation of
an existing route change subscription.
(On Android everything is working fine, since this plugin does not touch the AudioManager attributes)
With the added IosRecordConfig.manageAudioSession option set to false, I can circumvent these issues.
It defaults to true, so no changes in default behavior.
May I also suggest a renaming of the IosRecordConfig.audioCategories field to audioCategoryOptions?
Because the category, currently hardcoded to .playAndRecord, is a different property of the audio session.
I think the IosRecordConfig addition has not been released yet, so no breaking change would be introduced.
Hi there,
I'm using this plugin alongside just_audio and audio_session plugins in my app. Because my players have to support audio route switching, I am using the audio_session plugin for it. With this setup, I ran into the following issues when recording on iOS:
The reason for this is that AudioRecorder.start() also configures the shared AVAudioSession and activates it, after I already have configured and activated it through audio_session. This re-activation can cause a delay in audio processing when recording and also explains the cancelation of an existing route change subscription.
(On Android everything is working fine, since this plugin does not touch the AudioManager attributes)With the added
IosRecordConfig.manageAudioSession
option set to false, I can circumvent these issues. It defaults to true, so no changes in default behavior.May I also suggest a renaming of the
IosRecordConfig.audioCategories
field toaudioCategoryOptions
? Because the category, currently hardcoded to.playAndRecord
, is a different property of the audio session. I think the IosRecordConfig addition has not been released yet, so no breaking change would be introduced.