ideasman42 / nerd-dictation

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

Added --verbose flag for "begin" #85

Closed KJ7LNW closed 1 year ago

KJ7LNW commented 1 year ago

Moved suspend/resume notices to stderr and use --verbose flag

Added Model loading/loaded prints if --verbose is set. This is useful for large datsets because it takes a while to load. Then you can when it is ready to take dictation.

Signed-off-by: Eric Wheeler vosk-git@z.ewheeler.org

ideasman42 commented 1 year ago

Thanks for the contribution, I'd prefer to make verbose an integer.

... 3 could be used to print noisy information each time a chunk of data that's handled - for e.g. but that could be added later.

KJ7LNW commented 1 year ago

Prefer --verbose is an integer so different levels can be set.

Good idea. It is somehow inconsistent with the existing variable verbose that is passed to functions like main under suspend:

def main_suspend(
    *,
    path_to_cookie: str = "",
    suspend: bool,
    verbose: bool,  # <<<<<
) -> None:
    import signal

    if not path_to_cookie:
        path_to_cookie = os.path.join(tempfile.gettempdir(), TEMP_COOKIE_NAME)

    if not os.path.exists(path_to_cookie):
        if verbose:
            sys.stderr.write("No running nerd-dictation cookie found at: {:s}, abort!\n".format(path_to_cookie))
ideasman42 commented 1 year ago

Verbose can be made into an integer everywhere, perhaps renamed to verbose_level