llfbandit / record

Audio recorder from microphone to a given file path. No external dependencies, MediaRecorder is used for Android an AVAudioRecorder for iOS.
https://pub.dev/packages/record
233 stars 196 forks source link

Unexpected behaviour: can't play/pause audio using headphones after starting and stopping recording #391

Open bartolomej opened 1 month ago

bartolomej commented 1 month ago

Package version

Environment

Describe the bug

I'm using audio service lib to play audio and receive play/pause events. It all works as expected, but once I start (and later stop) recording using recorder library, the play/pause events are not received anymore. And that's even after I dispose of the recorder (call _audioRecorder.dispose()).

To Reproduce

Here is a reproducible example (hit the microphone button to start recording, and then hit it again to stop recording): https://github.com/bartolomej/audio-service-headset-controls-example

Expected behavior

I would expect the play/pause events to be received even if the audio is being recorded (or a configuration option that allows that). Note that I can play the audio while recording, but only by calling play/pause explicitly on the audio player, and not by using the headphone controls.