kevinresol / react-native-sound-recorder

Simplest Sound Recorder for React Native
MIT License
119 stars 36 forks source link

Allow recording while other media playing #44

Closed cark1 closed 4 years ago

cark1 commented 4 years ago

Using AVAudioSessionCategoryPlayAndRecord is possibile to have other media playing (for example a muted video).

If we have another active media (for example a video) and we try to terminate the AVAudioSession we have an error. And if we have an error, rejectStop is called and we lose the recording. We could just try to deactivate the AVAudioSession, but if this is not possible, we shouldn't make fail the recording entirely.

kevinresol commented 4 years ago

Completely ignoring the errors doesn't look good to me. Is there any ways to distinguish the different scenarios and still emit the error when appropriate?

cark1 commented 4 years ago

Yeah, you are totally right. We could skip the error only when we have this specific error code: AVAudioSessionErrorCodeIsBusy

kevinresol commented 4 years ago

Thanks!

cark1 commented 4 years ago

Hi @kevinresol , any chance to have a new release on npm? Thank you!

kevinresol commented 4 years ago

Released 1.4.0

cark1 commented 4 years ago

Released 1.4.0

Thank you!