Closed CarmeloBeeapp closed 8 months ago
Hey, thank you for your work. I kindly ask you to open an issue wherein you describe the problem you are trying to solve here. Since I'm not an iOS developer I need a bit more information to understand the necessity of this change
Hi, There is an open issue for this problem: https://github.com/anarchuser/mic_stream/issues/66
The PR doesn't change anything on your functionalities, it only resets the previous AudioSession category when the registration is completed
If I understand your changes correctly, you store the current session category when starting to record, and write it back once recording ends. This seems like a reasonable change to me. I don't see how it solves issue #66, though, since there the problem seems to be the new category we write, not the one active before we start recording.
Sorry, you're right. The issue #66 it's a little different, they try to record and play at the same time, instead I want to play audio before and after recording. The audio before the recording works correctly but without the change, the audio after the recording doesn't work
sorry for the wait. The goal of your PR is to save the current category on listen and restore it on cancel, right?
I've tried this MR, and it's working well but when the sound is resumed it is much less loud. Any idea?
One possibility could be that resuming mixes up parts of the audio settings and thus continues recording with a different category.
Otherwise, how are you playing back the audio? If it's on the phone also, do you notice any changes in the playback volume slider?
Also, if you print samples before and after resume, do they differ?
I'm playing back the audio with the "JustAudio" plugin and the volume slider is unchanged
I updated the MR, "onCancel" in SwiftMicStreamPlugin.swift was not called. I added a channel method ("clean") to reset the audio session manually
@CarmeloBeeapp I've been having a go with the latest version to see if it resolves the volume issue (we also experience this in the same way). Unfortunately, I'm not able to get it to build or run due to the use of the oldAudioSessionCategoryOptions
variable which never seems to be initialised anywhere?
Does this commit build and run for you and if so, where is that variable coming from?
@brightsign-ed Sorry, I forgot to push some changes. Now you shouldn't have build failures
I'll have a play again today and see how it goes 👍
I wonder if it is worth implementing a noAutomaticSession
option to prevent any of these mechanisms from running if the user doesn't want them to. I know other packages like flutter_sound
basically leave you to manage your own audio session if you want to as it can make things more interoperable between different audio packages.
The only downside is that you have to be careful as the user to make sure you are configuring the session for what the underlying packages all need.
This is working well for me, any plan to merge on master and create a new version?
ah, sorry, I've been very busy. I try to get it done ASAP.
Due to this PR being out-of-date I put the changes on a separate branch (fix/67/reset_audio_category) and published it as 0.7.2-dev
. Please give feedback about whether it works as intended or if any issues arise.
Into startCapture method, there is an override of audioSession category but the previous category wasn't set after stopping the session