manageAudioSession option for IosRecordConfig #401
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.