Skip to main content

CLI for Volcengine Doubao speech synthesis (TTS), with a companion Claude Code SKILL

Project description

seedaudio-cli

CLI for Volcengine Doubao speech synthesis (豆包语音合成大模型 2.0, seed-tts-2.0), with an accompanying SKILL for Claude Code / AI agents.

It targets the V3 HTTP Chunked unidirectional TTS endpoint (/api/v3/tts/unidirectional): one-shot text in, audio file out. Synthesis is synchronous — there is no task/polling model.

Install

# Recommended:
uv tool install zjandrew-seedaudio-cli

# Or with pipx:
pipx install zjandrew-seedaudio-cli

# Companion SKILL:
npx skills add zjandrew/seedaudio-cli -g -y

The PyPI distribution is named zjandrew-seedaudio-cli; the binary is still seedaudio-cli.

Local development:

git clone https://github.com/zjandrew/seedaudio-cli.git
cd seedaudio-cli
uv sync --all-extras
uv run seedaudio-cli --version

Configure

TTS auth is the 语音技术 console API Key model — a single X-Api-Key, not the Ark ARK_API_KEY Bearer that the video API uses. Get it from 控制台 > API Key 管理.

# Interactive wizard (creates ~/.seedaudio-cli/config.json, chmod 600):
seedaudio-cli config init

# Or env vars:
export SEEDAUDIO_API_KEY=...
export SEEDAUDIO_ENDPOINT=https://openspeech.bytedance.com   # optional

# Or programmatic:
seedaudio-cli config set api_key ...
seedaudio-cli config set default_voice zh_female_vv_uranus_bigtts
# resource_id is auto-inferred from the voice (S_/ICL_/saturn_ -> seed-icl-2.0, else
# seed-tts-2.0); set it only to pin/override globally:
seedaudio-cli config set resource_id seed-icl-2.0           # optional global pin

Priority: CLI flag > env var > config file > built-in default.

Multiple profiles

seedaudio-cli config list
seedaudio-cli config add prod
seedaudio-cli config use prod
seedaudio-cli --profile prod synthesize -p "..."

Usage

# Text → speech (mp3)
seedaudio-cli synthesize -p "你好,欢迎使用豆包语音合成" \
  --voice zh_female_vv_uranus_bigtts --out hello.mp3

# Tune delivery
seedaudio-cli synthesize -p "新闻播报示例" --voice zh_male_liufei_uranus_bigtts \
  --speech-rate 10 --loudness-rate 0 --pitch 0 --encoding wav --sample-rate 24000 --out news.wav

# Emotion / style via voice instruction (context_texts)
seedaudio-cli synthesize -p "今天真是太开心啦" --voice zh_female_vv_uranus_bigtts \
  -m seed-tts-2.0-expressive --instruct "用特别开心、撒娇的语气说" --out happy.mp3

# Long text — the streaming endpoint returns a COMPLETE file in one request, even for
# thousands of chars / minutes of audio, so a whole article or chapter just works:
seedaudio-cli synthesize --text-file chapter1.txt --voice zh_male_xuanyijieshuo_uranus_bigtts --out chapter1.mp3
# (book-length >tens-of-thousands of chars: use Volcengine's async long-text API, not wrapped here)

# Multi-role dialogue: each line `角色: 台词`, mapped to a voice per role
seedaudio-cli dialogue --script play.txt \
  --voice 旁白=zh_male_xuanyijieshuo_uranus_bigtts \
  --voice 小美=zh_female_wenrouxiaoya_uranus_bigtts \
  --instruct 小美="用温柔的语气说" --out play.mp3

# Creative generation (seed-audio-1.0, <=120s): sound effects / reference audio or image.
# Needs the seed-audio-1.0 capability enabled in the console (separate from TTS).
seedaudio-cli create -p "下雨环境音,远处偶尔闷雷,舒缓" --out rain.mp3
seedaudio-cli create -p "用 @音频1 的音色温柔地说:晚安" --ref audio:./sample.wav --out g.mp3
seedaudio-cli create -p "给这个角色配一句台词" --ref image:./char.png --out line.mp3

# Word-level timestamps alongside the audio
seedaudio-cli synthesize -p "字幕对齐示例" --voice zh_female_vv_uranus_bigtts \
  --subtitle --out clip.mp3   # writes clip.mp3 + clip.mp3.words.json

# Discover voices (curated subset; full list in the console)
seedaudio-cli voices --language zh

# Dry run (prints the request body, no API call — works without credentials)
seedaudio-cli --dry-run synthesize -p "..." --voice zh_female_vv_uranus_bigtts

SKILL

skills/seedaudio/SKILL.md ships in this repo. Install for Claude Code:

npx skills add zjandrew/seedaudio-cli -g -y

Exit codes

Code Meaning
0 success
2 INVALID_INPUT / CONFIG_MISSING
3 IO_ERROR
4 API_ERROR
5 NETWORK_ERROR
10 INTERNAL

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zjandrew_seedaudio_cli-1.1.0.tar.gz (64.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zjandrew_seedaudio_cli-1.1.0-py3-none-any.whl (30.7 kB view details)

Uploaded Python 3

File details

Details for the file zjandrew_seedaudio_cli-1.1.0.tar.gz.

File metadata

  • Download URL: zjandrew_seedaudio_cli-1.1.0.tar.gz
  • Upload date:
  • Size: 64.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for zjandrew_seedaudio_cli-1.1.0.tar.gz
Algorithm Hash digest
SHA256 6d25a689ac723620d3b9f5fe292fb1d31ef346ad8a9c0a656465006d0ac82394
MD5 2938e0bcad2fd677cc0d56aec65c555f
BLAKE2b-256 982223c72a5abc10c21f5e50158139fbfe1f1815b0c05e2c34cc4aaf90167d49

See more details on using hashes here.

Provenance

The following attestation bundles were made for zjandrew_seedaudio_cli-1.1.0.tar.gz:

Publisher: release.yml on zjandrew/seedaudio-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zjandrew_seedaudio_cli-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for zjandrew_seedaudio_cli-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1abc39a3cbc5a324e0ae6e160f4bb958799a11c9cf76deb4c4eccadf4d158e76
MD5 8ecec0bcc47effdb6d5b1d52236f543a
BLAKE2b-256 a2912369e8a209495ee87cdd58a1d6abada3c9a24eedcf808391364fb18d84ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for zjandrew_seedaudio_cli-1.1.0-py3-none-any.whl:

Publisher: release.yml on zjandrew/seedaudio-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page