Open tpoindex opened 2 years ago
After playing a bit more, I'm thinking setting the variable 'progressive' should just be:
line 1353
progressive=not args.defer_output,
because the --continuous flag eliminates a space between words when a pause is detected. For my named pipe example, --continuous works, but if stdout is piped into another process, it might be better to have spaces left in.
@tpoindex Would you update this pull request to make the change you suggested to set progressive=not args.defer_output
?
Seems to me that --output STDOUT and --continuous should not defer writing text, this patch fixes that case.
This allows stdout text to go to a pipe or named pipe immediately. Backspaces are also passed, when the text is corrected by Vosk.
Here's a simple example of using a named pipe:
In another terminal:
Demo results:
I included a flush() on the existing handler, but I also had another version that checked for this condition and only then use flush(). Flushing stdout on every write shouldn't cause much harm, since we can only speak so fast :-)