speaker_helper.cli module

Command-line interface for speaker-helper.

Module summary

Exposes the library as a terminal tool with four sub-commands:

  • synth — synthesise text (or stdin) to a .wav file, offline or streaming, printing the measured duration and real-time factor.

  • voices — list the preset voices of an engine.

  • clone — register a cloned voice from reference audio (default: the bundled ref-malo) and print its id; missing transcripts come from vocal-helper.

  • eval — evaluate the engine against a dataset and gate on versioned thresholds (exit code 0 pass / 1 fail); see speaker_helper.eval.

  • speak-from — re-voice audio from a YouTube URL, podcast feed, or the microphone (speech-to-speech); see speaker_helper.sources.

  • serve — run the REST API server (see speaker_helper.api).

The --clone family of flags works with any command: speaker-helper --clone synth "Bonjour" synthesises in the cloned ref-malo voice.

Argument parsing uses the standard-library argparse so the CLI has no third-party dependency of its own.

Usage example

speaker-helper synth "Bonjour le monde." -o hello.wav --engine kokoro
echo "Texte depuis stdin." | speaker-helper synth -o out.wav
speaker-helper voices --engine kokoro
speaker-helper serve --host 0.0.0.0 --port 8080

Author

Warith HARCHAOUI — https://linkedin.com/in/warith-harchaoui

speaker_helper.cli.main(argv=None)[source]

CLI entry point.

Parameters:

argv (list of str or None) – Argument vector; defaults to sys.argv[1:].

Returns:

Process exit code (0 on success).

Return type:

int