Transcribe audio/video files using FunASR.
# Transcribe with default model (SenseVoice, 234M)
python scripts/transcribe.py audio.mp3
# Save to file
python scripts/transcribe.py audio.mp3 transcript.txt
# Switch to Nano model (800M, 31 languages)
python scripts/transcribe.py audio.mp3 transcript.txt --model=nano
# With timestamps for long audio (meetings, lectures)
python scripts/transcribe.py meeting.wav --verbose
# Extract audio then transcribe
ffmpeg -i video.mp4 -vn -acodec pcm_s16le -ar 16000 -ac 1 -y audio.wav
python scripts/transcribe.py audio.wav output.txt
Switch via --model=sensevoice or --model=nano. Default is sensevoice.
| Flag | Model | Params | Best For |
|---|---|---|---|
| ------ | ------- | -------- | ---------- |
--model=sensevoice | SenseVoiceSmall | 234M | Default — lightweight, zh/yue/en/ja/ko + emotion/event detection |
--model=nano | Fun-ASR-Nano-2512 | 800M | 31 languages, highest accuracy, dialect support |
Sub-models (auto-loaded):
fsmn-vad (voice activity detection)ct-punc (Chinese + English punctuation restoration)Supports WAV, MP3, M4A, FLAC. Videos require audio extraction with FFmpeg.
pip install funasr
brew install ffmpeg # macOS
Full install guide: references/installation.md
共 1 个版本