violet/voice.py

22 lines
355 B
Python
Raw Normal View History

2022-12-26 14:12:49 +01:00
import sys
import colorama
import pyttsx3
import violet
colorama.init(autoreset=True)
engine = pyttsx3.init()
while True:
try:
prompt = input(colorama.Fore.BLUE)
except KeyboardInterrupt:
sys.exit(0)
answer = violet.respond(prompt)
print(answer['colored'])
engine.say(answer['plain'])
engine.runAndWait()