Community编程与开发github.com

vahnxu/doubao-asr

Agent Skill: Transcribe audio files via ByteDance Volcengine Seed-ASR 2.0 (豆包录音文件识别模型2.0). Best-in-class Chinese speech recognition with step-by-step setup guide.

doubao-asr 是什么?

doubao-asr is a Claude Code agent skill that agent Skill: Transcribe audio files via ByteDance Volcengine Seed-ASR 2.0 (豆包录音文件识别模型2.0). Best-in-class Chinese speech recognition with step-by-step setup guide.

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add vahnxu/doubao-asr

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

doubao-asr 是做什么的?

Agent Skill: Transcribe audio files via ByteDance Volcengine Seed-ASR 2.0 (豆包录音文件识别模型2.0). Best-in-class Chinese speech recognition with step-by-step setup guide.

Overview

This skill provides transcription of audio files using ByteDance Volcengine's Seed-ASR 2.0 model. It is optimized for Chinese speech recognition and supports asynchronous processing of audio files.

Prerequisites

  • A Volcengine account with access to the Seed-ASR API
  • API access credentials (AK and SK)
  • Python 3.8+ environment

Setup

  1. Install required dependencies:
pip install volcengine-python-sdk
  1. Configure environment variables:
export VOLC_ACCESSKEY="your_access_key"
export VOLC_SECRETKEY="your_secret_key"
  1. Create a client instance in your code:
from volcengine.asr import AsrService

asr_service = AsrService()
asr_service.set_ak("your_access_key")
asr_service.set_sk("your_secret_key")

Usage

Submit an audio file for transcription:

def transcribe_audio(audio_url: str, app_id: str = "your_app_id") -> dict:
    """
    Transcribe an audio file using Seed-ASR 2.0.
    
    Args:
        audio_url: URL or path to the audio file
        app_id: Application ID from Volcengine
    
    Returns:
        Dictionary with transcription results
    """
    request = {
        "appid": app_id,
        "language": "zh",
        "audio_url": audio_url,
        "model_type": "seed_asr_v2"
    }
    
    response = asr_service.submit_task(request)
    return response

Check transcription status:

def check_status(task_id: str) -> dict:
    response = asr_service.get_task_result(task_id)
    return response

Parameters

ParameterDescriptionTypeRequired
appidApplication IDstringYes
languageLanguage code (e.g., zh for Chinese)stringYes
audio_urlPublic URL of the audio filestringYes
model_typeModel type, use seed_asr_v2stringYes
callback_urlOptional callback URL for async notificationsstringNo

Supported Audio Formats

  • MP3
  • WAV
  • FLAC
  • AAC
  • M4A

Error Handling

try:
    result = transcribe_audio("https://example.com/audio.mp3")
    print(result)
except Exception as e:
    print(f"Transcription failed: {e}")

Notes

  • The API operates asynchronously; poll for results after submission
  • Audio file size should not exceed 500MB
  • For longer recordings, consider splitting into chunks
  • Refer to Volcengine documentation for detailed API reference

相关技能