ideasman42 / nerd-dictation

Simple, hackable offline speech to text - using the VOSK-API.
GNU General Public License v3.0
1.27k stars 106 forks source link

Feature request: Play user configurable soundbite after model loaded #93

Open bsaunder2002 opened 1 year ago

bsaunder2002 commented 1 year ago

Hello, Thank you! Been a long time since I first played with IBM ViaVoice for linux...wow, things have improved. Simple keyboard macro to start/stop nerd-dictation and I'm no longer typing...now I'm talking away...

Using an old computer, loading the voice model and actually starting to listen takes a while. On the small 50MB model, it's nearly instantaneous. On the 120MB+ models, there's about 7 or 8 seconds before what I say gets typed. (Can only imagine what one of the GB models takes...)

My keyboard macro speaks a phrase "transcribing" (via espeak) right before it starts nerd-dictation and plays another phrase "fingers in ears" right after nerd-dictation is killed.

I'd like nerd dictation to have a configuration option to play a sound bite once it's actually ready to dictate. Say something like --readyPhrase staring.mp3.

That way I could hit my keyboard macro, and hear "Starting"... (This would eliminate my current macro saying something like "transcribing" prior to starting nerd-dictate...but would still require my macro to say something like "fingers in ears" when stopping. I really neead the --readyPhrase, not so much the --stopPhrase though you could throw that in for consistency.)

ps- I'll look into suspend/resume as faster start/stop options but really like to run progs when I need them and not leave them running in the background.

Thanks!

ideasman42 commented 1 year ago

For cases where start time is very slow, there is now the capability to pause & resume the process (which shuts down and starts audio recording).

As for playing a sound, I think it makes more sense for the user configuration to handle this. We can support functions nerd_dictation_setup() & nerd_dictation_teardown() which run on start/exit. You can then add whatever you like in those functions.