From 844f02c8fcc29e9bfda8605053d7c0e0b7608eec Mon Sep 17 00:00:00 2001 From: rnentjes Date: Sun, 15 Jun 2025 13:11:30 +0200 Subject: [PATCH] Specify language parameter in `transcribe` method to enable customizable transcription inputs --- speech2text.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/speech2text.py b/speech2text.py index 282d0a2..84f19e5 100644 --- a/speech2text.py +++ b/speech2text.py @@ -131,7 +131,9 @@ class SpeechApp(Gtk.Window): wf.setframerate(SAMPLE_RATE) wf.writeframes((audio_np * 32767).astype(np.int16).tobytes()) - result = model.transcribe(tmpfile.name) + # In the transcribe_and_type method, modify the transcribe call: + # Replace "en" with your desired language code + result = model.transcribe(tmpfile.name, language="en") text = result["text"].strip() # Display the text in the text area