mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-12-23 16:21:26 +01:00
Fix crash when asking for Mic permissions, stopRecord is called with no codec
This commit is contained in:
parent
fa2d9e90ed
commit
b993bd9aef
@ -118,12 +118,13 @@ class VoiceRecorderL(
|
||||
}
|
||||
|
||||
override fun stopRecord() {
|
||||
val recorder = this.audioRecorder ?: return
|
||||
recordingJob?.cancel()
|
||||
|
||||
if (audioRecorder?.state == AudioRecord.STATE_INITIALIZED) {
|
||||
audioRecorder?.stop()
|
||||
if (recorder.state == AudioRecord.STATE_INITIALIZED) {
|
||||
recorder.stop()
|
||||
}
|
||||
audioRecorder?.release()
|
||||
recorder.release()
|
||||
audioRecorder = null
|
||||
|
||||
noiseSuppressor?.release()
|
||||
|
Loading…
Reference in New Issue
Block a user