Text-to-Speech Commands
Basic Synthesis
Section titled “Basic Synthesis”dg speak "Hello from Deepgram" -o hello.wavSave to File
Section titled “Save to File”dg speak "Hello from Deepgram" -o hello.wav
dg speak "Hello" -m aura-2-luna-en --encoding mp3 -o hello.mp3Pipe to Speaker
Section titled “Pipe to Speaker”echo "Latest headlines" | dg speak | ffplay -nodisp -autoexit -Options
Section titled “Options”Model Selection
Section titled “Model Selection”dg speak "Hello" --model flux-alexis-en -o hello.wav
dg speak "Hello" -m aura-2-luna-en --encoding mp3 -o hello.mp3dg speak defaults to flux-alexis-en. Flux TTS uses the Speak v2 WebSocket API and streams raw audio; when writing the default linear16 output to a file, the CLI wraps it in a WAV container. Use an aura-* model for the Speak v1 REST API.
List available TTS models:
dg models --type ttsOutput Format
Section titled “Output Format”-o or --output sets the output file path. To select audio encoding, use --encoding; Aura models also support --container.
dg speak "Hello" -o hello.wav
dg speak "Hello" -m aura-2-asteria-en --encoding mp3 -o hello.mp3
dg speak "Hello" -m aura-2-asteria-en --encoding linear16 --container wav -o hello.wavStreaming
Section titled “Streaming”Flux TTS streams audio by default. Pipe the WAV stream to a player instead of writing it to a file:
dg speak "Hello" | ffplay -loglevel error -nodisp -autoexit -Flux models also support --speed from 0.85 to 1.15 in 0.05 increments and beta --expressivity from -2 to 2:
dg speak "A little slower" --speed 0.9 --expressivity 1 -o slow.wavExample Workflows
Section titled “Example Workflows”Batch Synthesis
Section titled “Batch Synthesis”# Synthesize multiple phrases
for text in "Hello" "Goodbye" "Thank you"; do
dg speak "$text" -o "$text.wav"
doneLanguage Selection
Section titled “Language Selection”Choose a model for the required language. The language is part of the model identifier; dg speak does not have a --language option.
dg speak "Hola" -m aura-2-selena-es --encoding mp3 -o hola.mp3