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() {
|
override fun stopRecord() {
|
||||||
|
val recorder = this.audioRecorder ?: return
|
||||||
recordingJob?.cancel()
|
recordingJob?.cancel()
|
||||||
|
|
||||||
if (audioRecorder?.state == AudioRecord.STATE_INITIALIZED) {
|
if (recorder.state == AudioRecord.STATE_INITIALIZED) {
|
||||||
audioRecorder?.stop()
|
recorder.stop()
|
||||||
}
|
}
|
||||||
audioRecorder?.release()
|
recorder.release()
|
||||||
audioRecorder = null
|
audioRecorder = null
|
||||||
|
|
||||||
noiseSuppressor?.release()
|
noiseSuppressor?.release()
|
||||||
|
Loading…
Reference in New Issue
Block a user