Open Pixellevel opened 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.
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.
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()
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()
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?