Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

SenseVoice

> 开发工具
Open source

Open-source SenseVoiceSmall model for Mandarin, Cantonese, English, Japanese, and Korean ASR, language ID, emotion recognition, and audio event detection.

9.0K stars0 likes31 views
WebsiteGitHub

About

Open-source SenseVoiceSmall model for Mandarin, Cantonese, English, Japanese, and Korean ASR, language ID, emotion recognition, and audio event detection.

(简体中文|English|日本語)

Introduction

SenseVoice is a speech foundation model with multiple speech understanding capabilities, including automatic speech recognition (ASR), spoken language identification (LID), speech emotion recognition (SER), and audio event detection (AED).

Released checkpoint scope: SenseVoiceSmall supports ASR and language ID for Mandarin, Cantonese, English, Japanese, and Korean, together with emotion and audio-event tags. Speaker diarization is a composed FunASR pipeline using separate FSMN-VAD and CAM++ models; it is not an output of the SenseVoiceSmall checkpoint itself.

Highlights

SenseVoice focuses on high-accuracy multilingual speech recognition, speech emotion recognition, and audio event detection.

  • Research scope vs released checkpoint: The broader SenseVoice work reports training on more than 400,000 hours and support for more than 50 languages. The released SenseVoiceSmall checkpoint linked above supports Mandarin, Cantonese, English, Japanese, and Korean; the benchmark comparisons below are task- and language-specific.
  • Rich transcribe:
    • Possess excellent emotion recognition capabilities, achieving and surpassing the effectiveness of the current best emotion recognition models on test data.
    • Offer sound event detection capabilities, supporting the detection of various common human-computer interaction events such as bgm, applause, laughter, crying, coughing, and sneezing.
  • Efficient Inference: SenseVoiceSmall uses a non-autoregressive end-to-end framework for low-latency inference; see the benchmark setup and comparison below.
  • Convenient Finetuning: Provide convenient finetuning scripts and strategies, allowing users to easily address long-tail sample issues according to their business scenarios.
  • Service Deployment: Offer service deployment pipeline, supporting multi-concurrent requests, with client-side languages including Python, C++, HTML, Java, and C#, among others.

What's New

  • Current deployment path: install funasr==1.4.14 for SenseVoice Python, OpenAI-compatible service, and container workflows. Release notes · SenseVoice releases
  • Long audio without VAD: long_audio_no_vad.py uses bounded overlapping windows and preserves raw chunk outputs, so hour-scale recordings do not require one unbounded GPU allocation. Run it ->
  • Integrated diarization alternative: the wider FunASR ecosystem supports OpenMOSS/MOSS-Transcribe-Diarize for offline transcription, timestamps, and anonymous speaker labels without composing external VAD and speaker models. Deployment guide ->

See Releases for the complete version history.

Benchmarks

Multilingual Speech Recognition

We compared the performance of multilingual speech recognition between SenseVoice and Whisper on open-source benchmark datasets, including AISHELL-1, AISHELL-2, Wenetspeech, LibriSpeech, and Common Voice. In terms of Chinese and Cantonese recognition, the SenseVoice-Small model has advantages.

Speech Emotion Recognition

Due to the current lack of widely-used benchmarks and methods for speech emotion recognition, we conducted evaluations across various metrics on multiple test sets and performed a comprehensive comparison with numerous results from recent benchmarks. The selected test sets encompass data in both Chinese and English, and include multiple styles such as performances, films, and natural conversations. Without finetuning on the target data, SenseVoice was able to achieve and exceed the performance of the current best speech emotion recognition models.

For a reproducible zero-shot CASIA or RAVDESS rerun, use the SER evaluation contract. It reads the raw SenseVoice emotion tag and reports both UA and WA instead of deriving labels from formatted transcription text.

Furthermore, we compared multiple open-source speech emotion recognition models on the test sets, and the results indicate that the SenseVoice-Large model achieved the best performance on nearly all datasets, while the SenseVoice-Small model also surpassed other open-source models on the majority of the datasets.

Audio Event Detection

Although trained exclusively on speech data, SenseVoice can still function as a standalone event detection model. We compared its performance on the environmental sound classification ESC-50 dataset against the widely used industry models BEATS and PANN. The SenseVoice model achieved commendable results on these tasks. However, due to limitations in training data and methodology, its event classification performance has some gaps compared to specialized AED models.

Computational Efficiency

In the benchmark setup shown below, SenseVoiceSmall uses a non-autoregressive end-to-end architecture and, at a similar parameter count, runs more than 5 times faster than Whisper-Small and 15 times faster than Whisper-Large.

Requirements

bash
pip install -r requirements.txt

SenseVoiceSmall examples and the composed FunASR diarization path require funasr>=1.3.26. If you installed this repository earlier, run pip install -U "funasr>=1.3.26" before retrying the demos.

Usage

Inference

Supports common audio formats. Long recordings must be segmented before they are sent to the encoder; the example below uses FSMN-VAD for that segmentation.

…
Parameter Description (Click to Expand)
  • model_dir: The name of the model, or the path to the model on the local disk.
  • trust_remote_code:
    • When True, it means that the model's code implementation is loaded from remote_code, which specifies the exact location of the model code (for example, model.py in the current directory). It supports absolute paths, relative paths, and network URLs.
    • When False, it indicates that the model's code implementation is the integrated version within FunASR. At this time, modifications made to model.py in the current directory will not be effective, as the version loaded is the internal one from FunASR. For the model code, click here to view.
  • vad_model: This indicates the activation of VAD (Voice Activity Detection). The purpose of VAD is to split long audio into shorter clips. In this case, the inference time includes both VAD and SenseVoice total consumption, and represents the end-to-end latency. If you wish to test the SenseVoice model's inference time separately, the VAD model can be disabled.
  • vad_kwargs: Specifies the configurations for the VAD model. max_single_segment_time: denotes the maximum duration for audio segmentation by the vad_model, with the unit being milliseconds (ms).
  • use_itn: Whether the output result includes punctuation and inverse text normalization.
  • batch_size_s: Indicates the use of dynamic batching, where the total duration of audio in the batch is measured in seconds (s).
  • merge_vad: Whether to merge short audio fragments segmented by the VAD model, with the merged length being merge_length_s, in seconds (s).
  • ban_emo_unk: Whether to ban the output of the emo_unk token.

Long audio without VAD

Passing an hour-long waveform to one model.generate call can make encoder memory grow far beyond the audio file size. When VAD is not acceptable, use the bounded-memory reference script instead. It decodes through ffmpeg, runs SenseVoice on fixed 30-second windows with 2 seconds of overlap, and does not configure a VAD model:

bash
python long_audio_no_vad.py meeting.mp3 \
  --output meeting.txt \
  --window-seconds 30 \
  --overlap-seconds 2

The merged transcript removes only exact text repeated across adjacent window boundaries. meeting.chunks.jsonl retains every raw model response and window offset, so nonmatching output is never silently discarded; pass --no-dedupe to disable even exact-overlap removal. Window offsets describe input boundaries, not word timestamps. This path avoids whole-recording encoder OOM, but fixed boundaries can still change recognition around a cut. The VAD pipeline above remains the recommended default when content-based segmentation is acceptable.

Speaker Diarization

This example composes SenseVoiceSmall with separate FSMN-VAD, CAM++, and punctuation models through FunASR. CAM++ provides the speaker labels; the SenseVoiceSmall checkpoint itself does not:

…

Use the current repository model.py with FunASR 1.4.15 or newer. A local source update is needed when using remote_code="./model.py"; upgrading the Python package alone does not update that file. This composition was tested on a fixed public sample, not validated for diarization accuracy.

With output_timestamp=True, timestamp contains [start_ms, end_ms] pairs aligned one-to-one with words. Older copies of this repository returned [token, start_seconds, end_seconds] triples, which are incompatible with FunASR's VAD timestamp aggregation. Direct callers must now read the token or word from words, not from timestamp[i][0]. See demo2.py. Speaker labels are anonymous clusters, not recognized personal identities.

If all inputs are short audios (<30s), and batch inference is needed to speed up inference efficiency, the VAD model can be removed, and batch_size can be set accordingly.

python
model = AutoModel(model=model_dir, trust_remote_code=True, device="cuda:0")

res = model.generate(
    input=f"{model.model_path}/example/en.mp3",
    cache={},
    language="zh", # "zh", "en", "yue", "ja", "ko", "nospeech"
    use_itn=False,
    batch_size=64, 
)

For more usage, please refer to docs

Inference directly

Supports input of audio in any format, with an input duration limit of 30 seconds or less.

python
from model import SenseVoiceSmall
from funasr.utils.postprocess_utils import rich_transcription_postprocess

model_dir = "iic/SenseVoiceSmall"
m, kwargs = SenseVoiceSmall.from_pretrained(model=model_dir, device="cuda:0")
m.eval()

res = m.inference(
    data_in=f"{kwargs['model_path']}/example/en.mp3",
    language="auto", # "zh", "en", "yue", "ja", "ko", "nospeech"
    use_itn=False,
    ban_emo_unk=False,
    **kwargs,
)

text = rich_transcription_postprocess(res[0][0]["text"])
print(text)

Export and Test

ONNX and Libtorch Export

ONNX

python
# pip3 install -U funasr funasr-onnx
from pathlib import Path
from funasr_onnx import SenseVoiceSmall
from funasr_onnx.utils.postprocess_utils import rich_transcription_postprocess

model_dir = "iic/SenseVoiceSmall"

model = SenseVoiceSmall(model_dir, batch_size=10, quantize=True)

# inference
wav_or_scp = ["{}/.cache/modelscope/hub/{}/example/en.mp3".format(Path.home(), model_dir)]

res = model(wav_or_scp, language="auto", use_itn=True)
print([rich_transcription_postprocess(i) for i in res])

Note: ONNX model is exported to the original model directory.

Libtorch

python
from pathlib import Path
from funasr_torch import SenseVoiceSmall
from funasr_torch.utils.postprocess_utils import rich_transcription_postprocess

model_dir = "iic/SenseVoiceSmall"

model = SenseVoiceSmall(model_dir, batch_size=10, device="cuda:0")

wav_or_scp = ["{}/.cache/modelscope/hub/{}/example/en.mp3".format(Path.home(), model_dir)]

res = model(wav_or_scp, language="auto", use_itn=True)
print([rich_transcription_postprocess(i) for i in res])

No

Issues· 11 open

View all issuesOpen on GitHub
  • #334

    Clarification: does MODEL_LICENSE §3 "reference and learning purposes only" restrict commercial use? / 关于 §3 与商用边界的确认

    questionneeds feedbackUpdated Sep 22, 2026
  • #212

    CASIA 数据集 SER 性能不能复现,测试结果只有34,而不是report的70

    questionneeds feedbackUpdated Sep 15, 2026
  • #291

    使用VAD + CAM++ speaker model + punctuation model 返回结果是空的

    questionneeds feedbackUpdated Sep 13, 2026
  • #215

    时间戳数量和字符数量不匹配【词粒度模式返回时间戳】

    questionneeds feedbackUpdated Sep 10, 2026
  • #339

    [Bug]: Unable to pull Docker image or start Docker service

    bugneeds feedbackUpdated Sep 5, 2026
  • #7

    torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 214.66 GiB.

    bugneeds feedbackUpdated Aug 31, 2026
  • #343

    在edge device 中,只能使用cpu推理吗

    bugquestionneeds feedbackUpdated Aug 28, 2026

> Tags

Casraudio-analysisaudio-event-detectioncantonese

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 29, 2026
Category开发工具
PricingOpen source

> Related tools

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具