Open tvraman opened 2 months ago
What do you mean by "call"?
If you are piping the output of piper to your audio player (as in the streaming audio example), then kill the whole thing (Ctrl-c in most common shells). Technically, you can kill the audio player (e.g. pkill aplayer
in another terminal), which will close the pipe and cause piper to also terminate.
If you are writing to a file / not streaming the output in real-time, then naturally just kill piper.
The problem is not with the killing the whole pipeline. The problem is that if that's the only way to stop speech, then the next utterance requires the whole engine to start up again, and that implies latency; not a huge problem for Home Assistant like uses, but not acceptable for projects like Emacspeak that provide auditory feedback for all of one's actions
--
Well, that's a completely different problem from your initial question.
See #376, #90
No, it is not different problem.
@tvraman is correct.
I think the simple fix would be to return from callback and if return code will be not 0, stop synthesis of next utterance.
@synesthesiam what do you think about that?
Of course it's a different problem. "How to stop synthesis" (Ctrl-c, kill, pkill, various TUI/GUI task managers) is different from "how to stop synthesis and continue using the same instance of Piper to synthesise multiple times, to reduce startup latency".
The latter might be better discussed in the context of #376.
Is there a call to stop speech once synthesis has started, other than chopping it off at the knees by killing the audio player?