The idea comes from this app (Keezy) : http://keezy.net/
Basically, I'm trying to allow a user to listen to audio and record at the same time. I am aware of the category AVAudioSessionCategoryPlayAndRecord
, BUT this category forces the volume of the AVAudioPlayer
to be reduced heavily.
Trying to record audio while at the AVAudioSessionCategoryPlayback
does not work (doesn't record anything) and the other categories don't seem relevant. I'm wondering if there is way to achieve what is done in Keezy - audio playback at high volume while allowing a user to record audio at the same time.
(Couldn't find any examples/topics about that solve this without the playback category.)
Visit Google Play Store and download the Together app. Launch your music app and play the desired track. Launch the Together app and tap the video camera icon at the bottom to start recording. The music should continue playing.
Many newer phones have started to have built-in screen record functions or apps that allow you to record internal audio. Android 10 is a version of the Android operating system that came out in 2019. It allows for internal audio recording, so you don't have to get an app to screen-record.
Although the solution still involved the PlayAndRecord category, what needed to be added was the "AVAudioSessionCategoryOptionDefaultToSpeaker" to the category options - that allowed the audio to be played at normal volume and record as well.
Example:
[[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionDefaultToSpeaker error:nil];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With