From 2f82233b2598ac8514ea5b4735cde941f0b2497f Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Wed, 20 Aug 2025 17:37:44 -0400 Subject: [PATCH] Higher quality audio recordings --- .../amethyst/ui/actions/uploads/VoiceMessageRecorder.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/uploads/VoiceMessageRecorder.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/uploads/VoiceMessageRecorder.kt index 750251cbe..5c5115eae 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/uploads/VoiceMessageRecorder.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/uploads/VoiceMessageRecorder.kt @@ -65,7 +65,9 @@ class VoiceMessageRecorder { this.amplitudes.clear() createRecorder(context).apply { - setAudioSource(MediaRecorder.AudioSource.MIC) + setAudioEncodingBitRate(16 * 44100) + setAudioSamplingRate(44100) // Set the desired audio sampling rate (e.g., 44.1 kHz) + setAudioSource(MediaRecorder.AudioSource.VOICE_RECOGNITION) setOutputFormat(MediaRecorder.OutputFormat.MPEG_4) setAudioEncoder(MediaRecorder.AudioEncoder.AAC) setOutputFile(outputFile)