|
| 1 | +# Hume TTS CLI |
| 2 | + |
| 3 | +This is a CLI for Hume AI's [Octave TTS](https://hume.ai/blog/octave-the-first-text-to-speech-model-that-understands-what-it-s-saying) API. |
| 4 | + |
| 5 | +Unlike conventional TTS that merely "reads" words, Octave is a speech-language model that understands what words mean in context, unlocking a new level of expressiveness. It acts out characters, generates voices from prompts, and takes instructions to modify the emotion and style of a given utterance. |
| 6 | + |
| 7 | +This CLI uses Hume's [Typescript SDK](https://github.com/humeai/hume-typescript-sdk) behind the scenes. |
| 8 | + |
| 9 | +## Quickstart |
| 10 | + |
| 11 | +```shell |
| 12 | +npm install -g @humeai-cli |
| 13 | +hume login |
| 14 | +# Use the browser to login to platform.hume.ai to retrieve your |
| 15 | +# API keys |
| 16 | +hume tts "Are you serious?" --description "whispered, hushed" |
| 17 | +hume voices create --name whisperer --last |
| 18 | +hume tts "I said, are you serious?" --voice-name whisperer |
| 19 | +``` |
| 20 | + |
| 21 | +## Installation |
| 22 | + |
| 23 | +The Hume CLI is distributed [via NPM](https://www.npmjs.com/package/@humeai/cli). You can install it globally via: |
| 24 | + |
| 25 | +```shell |
| 26 | +npm install -g @humeai/cli |
| 27 | +``` |
| 28 | + |
| 29 | +## Usage |
| 30 | + |
| 31 | +``` |
| 32 | +Text to speech |
| 33 | +
|
| 34 | +━━━ Usage ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
| 35 | +
|
| 36 | +$ hume tts <text> |
| 37 | +
|
| 38 | +━━━ Options ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
| 39 | +
|
| 40 | + -d,--description #0 Description of the desired voice |
| 41 | + -c,--continue,--context-generation-id #0 Previous generation ID for continuation |
| 42 | + -l,--last,--continue-from-last Use a generation from a previous synthesis as context. If the last synthesis was created with --num-generations > 1, you must also provide --last-index |
| 43 | + --last-index #0 Index of the generation to use from the previous synthesis. |
| 44 | + -o,--output-dir #0 Output directory for generated audio files |
| 45 | + -n,--num-generations #0 Number of variations to generate |
| 46 | + -p,--prefix #0 Filename prefix for generated audio |
| 47 | + --play #0 Play audio after generation: all variations, just the first, or none |
| 48 | + --play-command #0 Command to play audio files (uses $AUDIO_FILE as placeholder for file path) |
| 49 | + --api-key #0 Override the default API key |
| 50 | + --format #0 Output audio format |
| 51 | + -v,--voice-name #0 Name of a previously saved voice |
| 52 | + --voice-id #0 Direct voice ID to use |
| 53 | + --json Output in JSON format |
| 54 | + --pretty Output in human-readable format |
| 55 | + --base-url #0 Override the default API base URL (for testing purposes) |
| 56 | +
|
| 57 | +━━━ Details ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
| 58 | +
|
| 59 | +This command converts text to speech using Hume AI's advanced AI voice |
| 60 | +synthesis. You can specify voice characteristics through descriptions or use |
| 61 | +saved voices. |
| 62 | +
|
| 63 | +━━━ Examples ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
| 64 | +
|
| 65 | +Basic usage |
| 66 | + $ hume tts "Make sure to like and subscribe!" --description "The speaker is a charismatic, enthusiastic, male YouTuber in his 20s with a American accent, a slightly breathy voice, and a fast speaking rate." |
| 67 | +
|
| 68 | +Saving a voice you like (see `hume voices create --help`) |
| 69 | + $ hume voices create --name influencer_1 --last |
| 70 | +
|
| 71 | +Using a previously-saved voice |
| 72 | + $ hume tts "Thanks for the 100,000,000,000 likes guys!" -v influencer_1 |
| 73 | +
|
| 74 | +Reading from stdin |
| 75 | + $ echo "I wouldn't be here without you" | hume tts - -v influencer_1 |
| 76 | +
|
| 77 | +Continuing previous text |
| 78 | + $ hume tts "Take some arrows from the quiver" -v influencer_1 |
| 79 | + $ hume tts "Take a bow, too" -v influencer_1 --last # should rhyme with 'toe' not 'cow' |
| 80 | +
|
| 81 | +Using custom audio player (macOS/Linux) |
| 82 | + $ hume tts "Hello world" -v narrator --play-command "mpv $AUDIO_FILE --no-video" |
| 83 | +
|
| 84 | +Using custom audio player (Windows) |
| 85 | + $ hume tts "Hello world" -v narrator --play-command "powershell -c \"[System.Media.SoundPlayer]::new('$AUDIO_FILE').PlaySync()\"" |
| 86 | +
|
| 87 | +Setting a custom audio player for the session |
| 88 | + $ hume session set tts.playCommand "vlc $AUDIO_FILE --play-and-exit" |
| 89 | +
|
| 90 | +━━━ See also ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
| 91 | + * `hume voices create --help` - Save a voice for later use |
| 92 | + * `hume session --help` - Save settings temporarily so you don't have to repeat yourself |
| 93 | + * `hume config --help` - Save settings more permanently |
| 94 | +``` |
0 commit comments