Closed synox closed 8 months ago
It's a cool idea, I'll look into adding it.
I have added an exit word option, i.e. if you run "hear -x 'quit'", the transcription session will end as soon as you say the word 'quit'. That might help with your use case.
Btw, as for control characters, they are only emitted in single-line mode, which is intended for presentation in a terminal client. Omit the "--mode" flag if you don't want them.
Thanks!
I wish
hear
could stop automatically, instead of staying active. Maybe when there is no more input for 3 seconds, or when reaching a user-defined text length?In my simple game, the user has to say back the word.
However pressing CTRL-C to stop the listening it stops the script instead.
Also for scripting, the ESCAPE-DELETE control characters get into the way. A plain text output when the program is complete would be preffered. The --mode output looks like this
Workarounds:
response=$(timeout 4 hear --mode)
response=$(echo "$response" | sed 's/.*\[2K//g' | tr -d '\r\n')