from RealtimeSTT import AudioToTextRecorder
from RealtimeTTS import TextToAudioStream, KokoroEngine
if __name__ == '__main__':
print("Wait until it says 'speak now'")
recorder = AudioToTextRecorder()
engine = KokoroEngine()
stream = TextToAudioStream(engine)
engine.set_voice('jf_alpha')
def process_text(text):
stream.feed(text).play()
print(text)
while True:
recorder.text(process_text)
python3 3.11.9 버전에서 테스트 했음.
3.12 이상은 지원하지 않는다고 하니 주의.