Skip to main content
Deepgram's Docs

Search documentation

Type to search this documentation.

On this pageOverview

Text-to-Speech Commands

Shell
dg speak "Hello from Deepgram" -o hello.wav
Shell
dg speak "Hello from Deepgram" -o hello.wav
dg speak "Hello" -m aura-2-luna-en --encoding mp3 -o hello.mp3
Shell
echo "Latest headlines" | dg speak | ffplay -nodisp -autoexit -
Shell
dg speak "Hello" --model flux-alexis-en -o hello.wav
dg speak "Hello" -m aura-2-luna-en --encoding mp3 -o hello.mp3

dg 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:

Shell
dg models --type tts

-o or --output sets the output file path. To select audio encoding, use --encoding; Aura models also support --container.

Shell
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.wav

Flux TTS streams audio by default. Pipe the WAV stream to a player instead of writing it to a file:

Shell
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:

Shell
dg speak "A little slower" --speed 0.9 --expressivity 1 -o slow.wav
Shell
# Synthesize multiple phrases
for text in "Hello" "Goodbye" "Thank you"; do
  dg speak "$text" -o "$text.wav"
done

Choose a model for the required language. The language is part of the model identifier; dg speak does not have a --language option.

Shell
dg speak "Hola" -m aura-2-selena-es --encoding mp3 -o hola.mp3
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu