Skip to content

Commit acd2f3f

Browse files
committed
initial
0 parents  commit acd2f3f

20 files changed

+3414
-0
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup Bun
17+
uses: oven-sh/setup-bun@v1
18+
with:
19+
bun-version: latest
20+
21+
- name: Install dependencies
22+
run: bun install
23+
24+
- name: Run tests
25+
run: bun test
26+
27+
- name: Check types
28+
run: bun typecheck
29+
30+
- name: Check formatting
31+
run: bun format:check

.github/workflows/main.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Test Bun PowerShell DateTime
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
test-bun-powershell:
8+
runs-on: windows-latest
9+
steps:
10+
- name: Checkout repository
11+
uses: actions/checkout@v4
12+
13+
- name: Install Bun
14+
shell: pwsh
15+
run: |
16+
iwr https://bun.sh/install.ps1 -Useb | iex
17+
18+
- name: Add Bun to PATH
19+
shell: pwsh
20+
run: |
21+
echo "$HOME\.bun\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
22+
23+
- name: Test Process StartTime
24+
shell: pwsh
25+
run: |
26+
bun install && bun run src/config.ts

.gitignore

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
tts-audio
2+
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore
3+
4+
# Logs
5+
6+
logs
7+
_.log
8+
npm-debug.log_
9+
yarn-debug.log*
10+
yarn-error.log*
11+
lerna-debug.log*
12+
.pnpm-debug.log*
13+
14+
# Caches
15+
16+
.cache
17+
18+
# Diagnostic reports (https://nodejs.org/api/report.html)
19+
20+
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
21+
22+
# Runtime data
23+
24+
pids
25+
_.pid
26+
_.seed
27+
*.pid.lock
28+
29+
# Directory for instrumented libs generated by jscoverage/JSCover
30+
31+
lib-cov
32+
33+
# Coverage directory used by tools like istanbul
34+
35+
coverage
36+
*.lcov
37+
38+
# nyc test coverage
39+
40+
.nyc_output
41+
42+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
43+
44+
.grunt
45+
46+
# Bower dependency directory (https://bower.io/)
47+
48+
bower_components
49+
50+
# node-waf configuration
51+
52+
.lock-wscript
53+
54+
# Compiled binary addons (https://nodejs.org/api/addons.html)
55+
56+
build/Release
57+
58+
# Dependency directories
59+
60+
node_modules/
61+
jspm_packages/
62+
63+
# Snowpack dependency directory (https://snowpack.dev/)
64+
65+
web_modules/
66+
67+
# TypeScript cache
68+
69+
*.tsbuildinfo
70+
71+
# Optional npm cache directory
72+
73+
.npm
74+
75+
# Optional eslint cache
76+
77+
.eslintcache
78+
79+
# Optional stylelint cache
80+
81+
.stylelintcache
82+
83+
# Microbundle cache
84+
85+
.rpt2_cache/
86+
.rts2_cache_cjs/
87+
.rts2_cache_es/
88+
.rts2_cache_umd/
89+
90+
# Optional REPL history
91+
92+
.node_repl_history
93+
94+
# Output of 'npm pack'
95+
96+
*.tgz
97+
98+
# Yarn Integrity file
99+
100+
.yarn-integrity
101+
102+
# dotenv environment variable files
103+
104+
.env
105+
.env.development.local
106+
.env.test.local
107+
.env.production.local
108+
.env.local
109+
110+
# parcel-bundler cache (https://parceljs.org/)
111+
112+
.parcel-cache
113+
114+
# Next.js build output
115+
116+
.next
117+
out
118+
119+
# Nuxt.js build / generate output
120+
121+
.nuxt
122+
dist
123+
124+
# Gatsby files
125+
126+
# Comment in the public line in if your project uses Gatsby and not Next.js
127+
128+
# https://nextjs.org/blog/next-9-1#public-directory-support
129+
130+
# public
131+
132+
# vuepress build output
133+
134+
.vuepress/dist
135+
136+
# vuepress v2.x temp and cache directory
137+
138+
.temp
139+
140+
# Docusaurus cache and generated files
141+
142+
.docusaurus
143+
144+
# Serverless directories
145+
146+
.serverless/
147+
148+
# FuseBox cache
149+
150+
.fusebox/
151+
152+
# DynamoDB Local files
153+
154+
.dynamodb/
155+
156+
# TernJS port file
157+
158+
.tern-port
159+
160+
# Stores VSCode versions used for testing VSCode extensions
161+
162+
.vscode-test
163+
164+
# yarn v2
165+
166+
.yarn/cache
167+
.yarn/unplugged
168+
.yarn/build-state.yml
169+
.yarn/install-state.gz
170+
.pnp.*
171+
172+
# IntelliJ based IDEs
173+
.idea
174+
175+
# Finder (MacOS) folder config
176+
.DS_Store
177+
178+
bin
179+
mcp
180+
CLAUDE.md
181+
*.bun-build

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
dist
3+
mcp/node_modules
4+
tts-audio
5+
.github
6+
bun.lockb

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"tabWidth": 2,
5+
"printWidth": 100,
6+
"trailingComma": "es5"
7+
}

CONTRIBUTING.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# tts-cli
2+
3+
To install dependencies:
4+
5+
```bash
6+
bun install
7+
```
8+
9+
To run:
10+
11+
```bash
12+
bun run src/index.ts
13+
```
14+
15+
This project was created using `bun init` in bun v1.2.1. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.

README.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
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

Comments
 (0)