Doubao ASR
Transcribe audio files via ByteDance Volcengine's Seed-ASR 2.0 API. Best-in-class accuracy for Chinese (Mandarin, Cantonese, Sichuan dialect, etc.) and supports 13+ languages.
通过字节跳动火山引擎 Seed-ASR 2.0 大模型转写音频文件。中文识别(普通话、粤语、四川话等方言)准确率业界领先,支持 13+ 种语言。
Sending audio to OpenClaw
Currently, audio files can be sent to OpenClaw via messaging platforms such as Discord, Telegram, or WhatsApp. Send the audio file in a chat message and ask the bot to transcribe it.
目前可通过 Discord、Telegram 或 WhatsApp 等即时通讯平台向 OpenClaw 发送音频文件,发送后让 bot 转写即可。
Note: Direct voice recording in the OpenClaw web UI is not yet supported. Use a messaging app to send pre-recorded audio files.
提示:OpenClaw 网页端暂不支持直接录音,请通过即时通讯应用发送预录制的音频文件。
Quick start
python3 {baseDir}/scripts/transcribe.py /path/to/audio.m4a
Defaults:
- Model: Seed-ASR 2.0 Standard
- Output: stdout (transcript text)
Useful flags
python3 {baseDir}/scripts/transcribe.py /path/to/audio.m4a --out /tmp/transcript.txt
python3 {baseDir}/scripts/transcribe.py /path/to/audio.mp3 --format mp3
python3 {baseDir}/scripts/transcribe.py /path/to/audio.m4a --json --out /tmp/result.json
python3 {baseDir}/scripts/transcribe.py /path/to/audio.m4a --speakers # speaker diarization / 说话人分离
python3 {baseDir}/scripts/transcribe.py https://example.com/audio.mp3 # direct URL (skip upload)
How it works
The Doubao API accepts audio via URL (not direct file upload). The script:
- Uploads audio to Volcengine TOS (object storage) using a time-limited presigned URL — audio stays within Volcengine infrastructure, no third-party services involved
- Submits transcription task to Seed-ASR 2.0
- Polls until complete (typically 1-3 minutes for a 10-min audio)
- Returns transcript text
Privacy: By default, audio is uploaded to your own Volcengine TOS bucket via presigned URL. No data is sent to third-party services.
Custom upload endpoint
If you prefer to use a different storage service (e.g. Aliyun OSS, AWS S3, your own server), set DOUBAO_ASR_UPLOAD_URL to your upload endpoint. The script will POST the file as multipart form data and expect a JSON response with a url field.
You can also pass a direct audio URL as the argument to skip upload entirely:
python3 {baseDir}/scripts/transcribe.py https://your-bucket.tos.volces.com/audio.m4a
Dependencies
- Python 3.9+
requestslibrary:pip install requests
Credentials
Required: Doubao ASR API
Get credentials from the Volcengine Speech console:
- Open https://console.volcengine.com/speech/app
- Create an app (or use existing)
- In the left sidebar, find "豆包录音文件识别模型 2.0" and click into it
- Copy APP ID and Access Token
Set environment variables:
export VOLCENGINE_APP_ID="your_app_id"
export VOLCENGINE_ACCESS_TOKEN="your_access_token"
Required: Volcengine TOS (for audio upload)
The Doubao API requires audio to be accessible via URL. TOS provides secure, private temporary upload within Volcengine.
- Open https://console.volcengine.com/tos
- Create a bucket (e.g.
my-asr-audio, region: cn-beijing) - Get your IAM access key from https://console.volcengine.com/iam/keymanage/
export VOLCENGINE_ACCESS_KEY_ID="your_ak"
export VOLCENGINE_SECRET_ACCESS_KEY="your_sk"
export VOLCENGINE_TOS_BUCKET="your_bucket_name"
# Optional:
# export VOLCENGINE_TOS_REGION="cn-beijing" (default)
Alternative: Custom upload endpoint
Skip TOS setup by providing your own upload endpoint:
export DOUBAO_ASR_UPLOAD_URL="https://your-server.com/upload"
Supported formats
WAV, MP3, MP4, M4A, OGG, FLAC — up to 5 hours, 512MB max.