From 55f2726768ee1051c555b8c99542daf8eb0a29bd Mon Sep 17 00:00:00 2001 From: Ahmet Inan Date: Wed, 3 Jul 2024 08:39:33 +0200 Subject: [PATCH] release audio if initialization fails --- app/src/main/java/xdsopl/robot36/MainActivity.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/xdsopl/robot36/MainActivity.java b/app/src/main/java/xdsopl/robot36/MainActivity.java index c34f24a..5f048bd 100644 --- a/app/src/main/java/xdsopl/robot36/MainActivity.java +++ b/app/src/main/java/xdsopl/robot36/MainActivity.java @@ -229,6 +229,8 @@ private void initAudioRecord() { } startListening(); } else { + audioRecord.release(); + audioRecord = null; setStatus(R.string.audio_init_failed); } } catch (IllegalArgumentException e) {