I need to interpret the playing WAV:
1- Once the user starts talking.
2- Stop playing WAV files.
3- Listen to user voice again (To go to LINE 1)
Do you know which method or callback from STT is suitable for this scenario?
while True:
# LINE 1
stt_sentence = self.recorder.start()
# process the stt_sentence
# convert text chunks to WAV files
text_queue = Queue()
# I need a way to break from this loop once the user talks again
while not text_queue.empty():
# Convert text to wav using any TTS
wav_file = ....
self.player = ....
# I need a way to break from this loop once the user talks again
while self.player.getPos() != 0:
# This loop is used to keep the script here till the play finish playing the current WAV
I need to interpret the playing WAV: 1- Once the user starts talking. 2- Stop playing WAV files. 3- Listen to user voice again (To go to LINE 1)
Do you know which method or callback from STT is suitable for this scenario?