This commit is contained in:
Paul Gauthier 2023-08-10 17:12:19 -03:00
parent 7b993a9bbb
commit 4812d17372
2 changed files with 4 additions and 1 deletions

View file

@ -441,7 +441,10 @@ class Commands:
return return
text = voice.record_and_transcribe() text = voice.record_and_transcribe()
print()
self.io.user_input(text, log_only=False) self.io.user_input(text, log_only=False)
print()
return text return text

View file

@ -31,7 +31,7 @@ def record_and_transcribe():
with sf.SoundFile(filename, mode="x", samplerate=sample_rate, channels=1) as file: with sf.SoundFile(filename, mode="x", samplerate=sample_rate, channels=1) as file:
with sd.InputStream(samplerate=sample_rate, channels=1, callback=callback): with sd.InputStream(samplerate=sample_rate, channels=1, callback=callback):
input("Press ENTER when done speaking...") input("Recording... Press ENTER when done speaking...")
while not q.empty(): while not q.empty():
file.write(q.get()) file.write(q.get())