KoljaB / RealtimeSTT

A robust, efficient, low-latency speech-to-text library with advanced voice activity detection, wake word activation and instant transcription.
MIT License
2.09k stars 190 forks source link

I am unable to input non-English languages into the text box. #151

Open Pixellevel opened 6 days ago

Pixellevel commented 6 days ago

Print everything being said: `from RealtimeSTT import AudioToTextRecorder import pyautogui

def process_text(text): print(text)

if name == 'main': print("Wait until it says 'speak now'") recorder = AudioToTextRecorder()

while True:
    recorder.text(process_text)`

The script above works well, and it can display various languages in the window.

Type everything being said:

` from RealtimeSTT import AudioToTextRecorder import pyautogui

def process_text(text): pyautogui.typewrite(text + " ")

if name == 'main': print("Wait until it says 'speak now'") recorder = AudioToTextRecorder()

while True:
    recorder.text(process_text)`

When using this script, if the input speech is in English, it is recognized correctly. However, if the speech is in another language, it only outputs the last punctuation mark (".") of the recognized sentence, and no text is displayed. How can I resolve this issue?

KoljaB commented 6 days ago

pyautogui.typewrite simulates key presses, this is different from how print works. If you can't type into the currently active window manually using your keyboard, pyautogui.typewrite can't too.

homelab-00 commented 6 days ago

An alternative to pyautogui is pyperclip. It works fine for me both with English and Greek, and regardless of which language I have my keyboard set to.