fun-asr
Skill1 starsChanged 4 months agoMITView on GitHub
Use when the user shares an audio file (mp3, wav, m4a, flac) and asks to transcribe it to text — includes queries containing "speech recognition", "audio to text", "transcribe", "transcription", "ASR", "meeting notes", "convert audio", "subtitle", "SRT", "speaker diarization", "who said what". Also triggers on audio meeting recordings, interviews, phone calls, lectures, voice memos, podcasts. Requires DASHSCOPE_API_KEY (Alibaba Cloud DashScope) and S3-compatible storage credentials.
- Reads credentials
- Installs packages
In this repository19 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- calendar-apiSkill
- chinese-poetry-apiSkill
- deepseek-balanceSkill
- domain-querySkill
- enterprise-infoSkill
- epub-book-pipelineSkill
- freshrssSkill
- gaozhong-english-answer-parserSkill
- gotifySkill
- grillSkill
- img-recogSkill
- linkgoSkill
- mimo-ttsSkill
- personal-siyuan-standardsSkill
- scanned-pdf-to-epubSkill
- send-emailSkill
- wake-on-lanSkill
- zurlSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 57
Run from the scripts/ directory or provide the full path to fun_asr_cli.py.
- Distinctive: line 116
Run the user's requested command directly without pre-checking dependencies, environment variables, or configuration.
- Very specific: line 124
When transcription succeeds, stdout contains only: Output file: <path>.
- Distinctive: line 129
Read and present the file content to the user
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Fun-ASR: Audio Transcription
Transcribe audio files using Alibaba Cloud DashScope's Fun-ASR non-real-time speech recognition model. Supports speaker diarization, multi-language recognition, and multiple output formats (plain text, JSON, SRT subtitles).
Workflow
Audio → S3 → Fun-ASR async → Poll → Save file → Agent readsRequirements
Environment Variables
Set these in ~/.wmyskills/.env (shared across skills), or scripts/.env (takes priority). Use scripts/.env.example as the template — add the variables to ~/.wmyskills/.env, never overwriting an existing file:
| Variable | Required | Description |
DASHSCOPE_API_KEY | Yes | Alibaba Cloud DashScope API key (or use BAILIAN_APIKEY) |
BAILIAN_APIKEY | Yes* | Alternative to DASHSCOPE_API_KEY (Bailian/DashScope) |
S3_ENDPOINT | Yes | S3-compatible storage endpoint URL |
S3_BUCKET | Yes | S3 bucket name for audio uploads |
S3_REGION | No | S3 region (default: us-east-1) |
S3_PREFIX | No | Key prefix for uploads (default: asr-uploads) |
AWS_ACCESS_KEY_ID | No* | AWS access key (needed if not using IAM/default chain) |
AWS_SECRET_ACCESS_KEY | No* | AWS secret key (needed if not using IAM/default chain) |
The script loads .env from ~/.wmyskills/.env and scripts/.env automatically (script directory takes priority).
Python Dependencies
pip install boto3 requests python-dotenvOptional: ffmpeg
ffmpeg/ffprobe is needed for:
- Detecting audio channel count
- Converting multi-channel audio to mono (required for speaker diarization)
Without ffmpeg, the script skips mono conversion and uses the original file.
Usage
python fun_asr_cli.py <audio-file> [options]Run from the scripts/ directory or provide the full path to fun_asr_cli.py.
Positional Arguments
| Argument | Description |
file | Path to the audio file (aac, wav, mp3, m4a, flac, ogg, etc.) |
Options
| Option | Default | Description |
--model | fun-asr | ASR model: fun-asr, paraformer-v2, paraformer-v1, fun-asr-mtl, paraformer-mtl-v1 |
--no-diarization | (enabled) | Disable speaker diarization |
--language | zh | Language hint: zh, en, ja, ko, yue, etc. |
--channel-id | 0 | Audio channel to transcribe (0 = first/mono) |
--output | auto-generated | Custom output file path (default: ~/.wmyskills/fun-asr/outputs/) |
--format | text | Output format: text, json, srt |
--keep-s3 | (off) | Keep the uploaded file on S3 after transcription |
--version | — | Show script version and exit |
Examples
# Basic transcription (text format, Chinese)
python fun_asr_cli.py meeting.mp3
# JSON output with full metadata (timestamps, speaker IDs, confidence)
python fun_asr_cli.py interview.wav --format json
# SRT subtitle output
python fun_asr_cli.py lecture.mp3 --format srt
# Disable speaker diarization
python fun_asr_cli.py meeting.mp3 --no-diarization
# Specify language and model
python fun_asr_cli.py japanese_audio.mp3 --language ja --model paraformer-v2
# Custom output path
python fun_asr_cli.py audio.wav --output ~/Desktop/transcript.txtOutput Formats
text (default)
Plain text with speaker labels and timestamps: [Speaker N] HH:MM:SS - HH:MM:SS, followed by the text.
json
Full JSON with all metadata — timestamps, speaker IDs, confidence scores, and the raw API response.
srt
Standard SRT subtitle format: NN \n HH:MM:SS,mmm --> HH:MM:SS,mmm \n [SN] text.
Execution Rule
Run the user's requested command directly without pre-checking dependencies, environment variables, or configuration. If something is wrong, the script will fail with a clear error — check and fix only then.
Agent Instructions
After Transcription Completes
Transcription output is saved to a file — the text content is not printed to stdout. The only line printed to stdout is Output file: <path>, which tells you where the result file was saved. The default output directory is ~/.wmyskills/fun-asr/outputs/.
When transcription succeeds, stdout contains only: Output file: <path>. Info and error logs go to stderr.
On success you must deliver the result to the user:
- Parse the
Output file:path from stdout - Read and present the file content to the user
- Provide a brief summary: audio duration, number of speakers detected (if diarization was enabled), and a concise overview of the content
Error Scenarios
The script exits with specific codes for programmatic handling:
- Code 2 — Configuration error: missing env vars. Also used by argparse for invalid arguments (e.g. unknown flags, invalid model name).
- Code 3 — File error: file not found, too large, or exceeds limits.
- Code 4 — API/network error: submission or polling failed.
- Code 6 — Task failure: ASR API returned an error. Check the error message.
- Code 7 — Timeout: transcription took longer than 30 minutes.
Important Rules
- No valid speech detected: If the API returns
ASR_RESPONSE_HAVE_NO_WORDSorSUCCESS_WITH_NO_VALID_FRAGMENT, the audio contains no detectable human speech (silence, too quiet, or pure noise). Stop immediately and report this to the user. Do NOT retry automatically, switch models, or modify audio parameters. Only retry if the user explicitly asks. - Speaker diarization requires mono audio ≤ 2 hours. The script auto-converts multi-channel audio via ffmpeg. If the file exceeds 2 hours, diarization is disabled automatically.
- Diarization cost: The script charges per audio second regardless of diarization; there is no extra fee for enabling it.
- S3 cleanup: Temporary files on S3 are deleted automatically after transcription unless
--keep-s3is passed. - Pricing: Fun-ASR costs CNY 0.00022 / second of audio. The script estimates cost before starting and reports actual cost on completion.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

