Specify language parameter in transcribe method to enable customizable transcription inputs

This commit is contained in:
2025-06-15 13:11:30 +02:00
parent eb58ec0ca5
commit 844f02c8fc

View File

@@ -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