Minor change.
This commit is contained in:
parent
b8a517cc14
commit
84c83cfd70
13
tts.py
13
tts.py
@ -37,17 +37,18 @@ async def main():
|
||||
recognizer = sr.Recognizer()
|
||||
|
||||
with sr.Microphone() as source:
|
||||
print("Adjusting for ambient noise, please wait...")
|
||||
recognizer.adjust_for_ambient_noise(source, duration=1)
|
||||
print("Listening...")
|
||||
print("Adjusting to surroundings for a five seconds.")
|
||||
recognizer.adjust_for_ambient_noise(source, duration=5)
|
||||
|
||||
|
||||
while True:
|
||||
print("Listening...")
|
||||
try:
|
||||
audio_data = recognizer.listen(source, timeout=10)
|
||||
text = recognizer.recognize_google(audio_data, language="en-US")
|
||||
print(f"Recognized Text: {text}")
|
||||
text = recognizer.recognize_google(audio_data, language="nl-NL") #en-US
|
||||
print(f"You said:\n\t{text}")
|
||||
response_llm = molodetz.gpt4o_mini(text)
|
||||
print(f"Response from gpt4o_mini: {response_llm}")
|
||||
print(f"GPT4o mini said:\n\t{response_llm}")
|
||||
await gcloud.tts(response_llm)
|
||||
except sr.WaitTimeoutError:
|
||||
continue
|
||||
|
Loading…
Reference in New Issue
Block a user