Agent-readable docs index: /llms.txt. Full docs in one file: /llms-full.txt. Download /docs.zip to grep all markdown files locally.

Speech & Audio

egaki handles text-to-speech, voice cloning, audio stem separation, and BPM detection.

Text-to-speech

egaki speech "Hello, this is a test." -o hello.mp3
Specify a model and voice:
egaki speech "Welcome to the future of video." \ --model sonic-3.5 \ --voice <voice-id> \ -o narration.mp3

Read from stdin

Pipe text from a file:
cat script.txt | egaki speech --stdin -o narration.mp3

Speed control

Cartesia models support --speed from 0.6 to 1.5:
egaki speech "Speak faster." --speed 1.3 -o fast.mp3

Available providers

ProviderModelsNotes
OpenAItts-1, tts-1-hdStandard quality
Cartesiasonic-3.5, sonic-3Best quality, speed control
ElevenLabseleven_v3, eleven_multilingual_v2, eleven_flash_v2_5Multilingual

Voice cloning

Clone a voice from an audio clip and get a reusable voice ID:
egaki voice clone recording.mp3 --name "my-voice" --json

Workflow: clone from a song

Separate vocals first, then clone:
# 1. Separate vocals egaki demucs song.mp3 --stems vocals -o stems/ # 2. Clone the isolated voice egaki voice clone stems/song-vocals.mp3 --name "singer" --json # 3. Generate speech with the cloned voice egaki speech "Your text here." --voice <voice-id> -m sonic-3.5 -o output.mp3

Providers

  • Cartesia (default): instant cloning, up to 10s of audio, free
  • ElevenLabs: longer clips, --remove-background-noise option
egaki voice clone noisy-audio.mp3 \ --provider elevenlabs \ --name "clean-voice" \ --remove-background-noise \ --json

Audio stem separation (demucs)

Separate a song into individual stems using fal.ai's Demucs model:
egaki demucs song.mp3 --stems vocals,other -o stems/

Available stems

vocals, drums, bass, other, guitar, piano

Models

ModelStemsBest for
htdemucsvocals, drums, bass, otherGeneral purpose
htdemucs_ftvocals, drums, bass, otherFine-tuned, higher quality
htdemucs_6s (default)vocals, drums, bass, other, guitar, piano6-stem separation
egaki demucs song.mp3 --model htdemucs_6s --stems vocals,guitar -o stems/

BPM detection

Detect the tempo of an audio file locally. No API call needed; runs in milliseconds using peak detection and interval analysis.
egaki bpm song.mp3
Output:
BPM: 120 Interval: 0.500s
Use --json for structured output:
egaki bpm track.wav --json # { "bpm": 120, "intervalInSeconds": 0.5 }
Pipe audio from another command:
ffmpeg -i video.mp4 -f mp3 - | egaki bpm --stdin

Beat-synced videos

Use the detected BPM in your MDX frontmatter to align scene cuts to the music:
# 1. Detect the BPM egaki bpm soundtrack.mp3 --json # { "bpm": 129 } # 2. Use it in your video
--- fps: 30 bpm: 129 --- <Audio src="/soundtrack.mp3" /> # Verse duration=8beats Scene cuts land on the beat.

Optional dependency

BPM and loudness detection both require node-web-audio-api, a native audio processing library. It's listed as an optional dependency; if missing, the command prints install instructions:
pnpm add node-web-audio-api

Loudness measurement (LUFS)

Measure perceived loudness in LUFS using K-weighting and two-pass gating inspired by EBU R128. Runs locally, no API call needed.
egaki loudness song.mp3
Output:
Integrated: -14.2 LUFS Max: -8.1 LUFS Min: -28.4 LUFS Range: 20.3 LU
Use --json for structured output:
egaki loudness narration.mp3 --json

What the numbers mean

MetricDescription
IntegratedAverage perceived loudness across the whole file (gated)
MaxLoudest 400ms block
MinQuietest 400ms block above the gate threshold
RangeDynamic range (max - min) in LU

Common loudness targets

PlatformTarget LUFS
YouTube-14
Spotify-14
Apple Music-16
Podcast-16 to -18
Broadcast TV-24
Compare your audio against these targets to know if it needs volume adjustment before using it in a video.