Skip to content

Latest commit

 

History

History
68 lines (49 loc) · 1.85 KB

File metadata and controls

68 lines (49 loc) · 1.85 KB

🎤 Volcengine TTS Skill

Use Volcengine (ByteDance) Text-to-Speech API to synthesize speech from text.

When to use this skill

  • Convert text to speech using Volcengine TTS API
  • Generate audio files with different voices
  • Adjust speech speed, volume, and format

How it works

This skill calls the Volcengine TTS API to synthesize text into audio. It supports:

  • Multiple voice types (male/female, different styles)
  • Adjustable speed (0.1-2.0)
  • Adjustable volume (0.5-2.0)
  • Multiple formats (mp3/wav/ogg)

Configuration

  1. Copy config.example.json to config.json
  2. Fill in your Volcengine credentials:
    • appid: Your application ID
    • access_token: Your access token
  3. Optionally customize default settings

Important: config.json contains sensitive data and is excluded from git.

Usage

Call the tts.py script with text and optional parameters:

python3 tts.py "你好,很高兴认识你" \
  --voice zh_male_aojiaobazong_emo_v2_mars_bigtts \
  --speed 1.0 \
  --volume 1.0 \
  --format mp3 \
  --output output.mp3

Returns JSON with:

  • success: true/false
  • file: absolute path to generated audio
  • duration_ms: audio duration in milliseconds
  • voice: voice type used
  • text: input text

Common voices

  • zh_male_aojiaobazong_emo_v2_mars_bigtts - Male, authoritative
  • zh_female_xiaohe_uranus_bigtts - Female, gentle
  • BV001_streaming - Generic female (free)
  • BV002_streaming - Generic male (free)

See full list: https://www.volcengine.com/docs/6561/1257544

Error handling

  • Missing config: Returns error message
  • API errors: Returns error code and message
  • Network issues: Timeout after 30 seconds

Notes

  • Text length limit: 1024 bytes (recommend <300 characters)
  • Some voices require authorization in Volcengine console
  • Generated files are saved in current directory unless --output specified