Overview
FunASRSTTService provides offline speech recognition using FunASR’s SenseVoice models running locally on CPU or GPU. SenseVoice is a multilingual model with strong Chinese accuracy, supporting Chinese, Cantonese, English, Japanese, Korean, and other languages. The non-autoregressive architecture enables fast inference, making it a strong fully-local STT option for voice agents. No API key needed - models download once on first use and are cached locally for privacy-focused transcription.
FunASR STT API Reference
Pipecat’s API methods for FunASR STT integration
FunASR Example
Complete example with FunASR STT
FunASR Documentation
FunASR model details and research
SenseVoice Model
SenseVoice multilingual ASR model
Installation
Prerequisites
Local Model Setup
Before using FunASR STT service, you need:- Model Selection: Choose an appropriate FunASR model (default:
iic/SenseVoiceSmall) - Storage Space: Ensure sufficient disk space for model downloads (models are cached after first use)
- CPU or GPU Resources: FunASR can run on CPU or GPU (CUDA)
Configuration Options
- Model Selection: Default is
iic/SenseVoiceSmall, but other FunASR models are supported - Language Support: SenseVoice natively supports Chinese (
zh), Cantonese (yue), English (en), Japanese (ja), and Korean (ko) with automatic language detection for other languages - Device Selection: Choose
"cpu"or"cuda"based on your hardware - No API Key: Runs entirely locally for complete privacy
Configuration
Inference device. Use
"cpu" or "cuda" for GPU acceleration.Runtime-configurable settings for the STT service. See FunASRSTTSettings below.
FunASRSTTSettings
Runtime-configurable settings passed via thesettings constructor argument using FunASRSTTService.Settings(...). These can be updated mid-conversation with STTUpdateSettingsFrame. See Service Settings for details.
| Parameter | Type | Default | Description |
|---|---|---|---|
model | str | "iic/SenseVoiceSmall" | FunASR model identifier. Default is SenseVoiceSmall. (Inherited from base STT settings.) |
language | Language | str | Language.EN | Language for transcription. Natively supports Chinese (zh), Cantonese (yue), English (en), Japanese (ja), and Korean (ko). Falls back to auto-detection for other languages. (Inherited from base STT settings.) |
use_itn | bool | True | Apply inverse text normalization (e.g., converts spoken numbers like “nine” to numerals “9”). |
Usage
Basic Setup
With GPU Acceleration
With Custom Language
With Inverse Text Normalization Disabled
With Custom Model
Notes
- First run downloads: The selected model downloads from the ModelScope hub on first use and is cached locally. Later runs load it from the cache.
- Segmented transcription:
FunASRSTTServiceextendsSegmentedSTTService, meaning it processes complete audio segments after VAD detects the user has stopped speaking. - CPU and GPU support: FunASR can run on CPU or GPU (CUDA). Use the
deviceparameter to choose. - Audio format: Expects 16-bit mono PCM audio at 16 kHz sample rate.
- Multilingual support: SenseVoice natively supports Chinese, Cantonese, English, Japanese, and Korean. For other languages, it falls back to automatic language detection.
- No external dependencies: Unlike API-based STT services, FunASR requires no API keys or network connectivity after the initial model download.
- Inverse text normalization: By default,
use_itn=Trueconverts spoken numbers to numerals (e.g., “nine” → “9”). Disable this withuse_itn=Falseif you need the raw transcription. - Non-autoregressive inference: SenseVoice uses non-autoregressive architecture for fast inference, making it suitable for real-time voice agents.