Specify language parameter in transcribe method to enable customizable transcription inputs
This commit is contained in:
@@ -131,7 +131,9 @@ class SpeechApp(Gtk.Window):
|
|||||||
wf.setframerate(SAMPLE_RATE)
|
wf.setframerate(SAMPLE_RATE)
|
||||||
wf.writeframes((audio_np * 32767).astype(np.int16).tobytes())
|
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()
|
text = result["text"].strip()
|
||||||
|
|
||||||
# Display the text in the text area
|
# Display the text in the text area
|
||||||
|
|||||||
Reference in New Issue
Block a user