mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-18 20:29:10 +03:00
Fix crash when asking for Mic permissions, stopRecord is called with no codec
This commit is contained in:
parent
fa2d9e90ed
commit
b993bd9aef
1 changed files with 4 additions and 3 deletions
|
@ -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…
Add table
Reference in a new issue