Skip to main content
For the complete documentation index for agents and LLMs, see llms.txt.

FunASRTranscriber

Transcribe audio files to text using FunASR, an open source speech recognition toolkit from Alibaba DAMO Academy. Use this component as a local alternative to Whisper when you need multilingual transcription, speaker diarization, or timestamp extraction without an API key.

Key Features

  • Transcribes audio locally using FunASR models downloaded from ModelScope on first use.
  • Supports 50+ languages with models such as iic/SenseVoiceSmall, paraformer-zh, and paraformer-en.
  • Optional voice activity detection, punctuation restoration, and speaker diarization.
  • Accepts audio files as file paths, Path objects, or ByteStream objects.
  • Returns transcriptions as Haystack Document objects with optional timestamp and speaker metadata.
  • Configurable device support (CPU or GPU) for inference.

Configuration

Add Workspace-Level Integration

  1. Click your profile icon and choose Settings.
  2. Go to Workspace>Integrations.
  3. Find the provider you want to connect and click Connect next to them.
  4. Enter the API key and any other required details.
  5. Click Connect. You can use this integration in pipelines and indexes in the current workspace.

Add Organization-Level Integration

  1. Click your profile icon and choose Settings.
  2. Go to Organization>Integrations.
  3. Find the provider you want to connect and click Connect next to them.
  4. Enter the API key and any other required details.
  5. Click Connect. You can use this integration in pipelines and indexes in all workspaces in the current organization.
  1. Drag the FunASRTranscriber component onto the canvas from the Component Library.
  2. Click on the component to open the configuration panel.
  3. On the General tab:
    1. Set the model to the FunASR model you want to use. The default iic/SenseVoiceSmall supports 50+ languages and is faster than Whisper.
    2. Optionally enable vad_model, punc_model, and spk_model for segmentation, punctuation, and speaker diarization.
  4. Go to the Advanced tab to configure device, batch_size_s, store_full_path, and generation_kwargs.
note

Models are cached in ~/.cache/modelscope after the first download. GPU inference requires a CUDA-capable device.

Connections

FunASRTranscriber receives a list of audio file sources. It outputs a list of Document objects containing the transcription text. Connect its documents output to a splitter, embedder, or other pipeline components.

Source Code

To check this component's source code, open transcriber.py in the Haystack Core Integrations repository.

Usage Examples

Basic Configuration

  FunASRTranscriber:
type: haystack_integrations.components.audio.funasr.transcriber.FunASRTranscriber
init_parameters:
model: iic/SenseVoiceSmall
generation_kwargs:
language: auto

Using the Component in a Pipeline

# haystack-pipeline
components:
FunASRTranscriber:
type: haystack_integrations.components.audio.funasr.transcriber.FunASRTranscriber
init_parameters:
model: iic/SenseVoiceSmall
vad_model: fsmn-vad
punc_model: ct-punc

document_splitter:
type: haystack.components.preprocessors.document_splitter.DocumentSplitter
init_parameters:
split_by: word
split_length: 250
split_overlap: 30

connections:
- sender: FunASRTranscriber.documents
receiver: document_splitter.documents

max_runs_per_component: 100

metadata: {}

Parameters

Inputs

ParameterTypeDescription
sourcesList[Union[str, Path, ByteStream]]A list of audio file paths, Path objects, or ByteStream objects to transcribe. Supported formats include WAV, MP3, FLAC, OGG, M4A, AAC, and MP4.
metaOptional[Union[Dict[str, Any], List[Dict[str, Any]]]]Metadata to attach to the produced documents. Pass a single dict to apply the same metadata to all documents, or a list aligned with sources.

Outputs

ParameterTypeDescription
documentsList[Document]One document per source whose content holds the full transcript text. Metadata may include file_path, timestamps, and speakers.

Init Parameters

These are the parameters you can configure in Pipeline Builder:

ParameterTypeDefaultDescription
modelstriic/SenseVoiceSmallFunASR model name or local path. Alternatives include paraformer-zh (Chinese) and paraformer-en (English).
vad_modelOptional[str]fsmn-vadVoice activity detection model used to split long audio into segments. Set to None to process the audio as a single stream.
punc_modelOptional[str]ct-puncPunctuation restoration model. Set to None to disable punctuation.
spk_modelOptional[str]NoneSpeaker diarization model (for example, cam++). When set, a speakers key is included in document metadata.
deviceOptional[ComponentDevice]NoneThe device to run inference on. If not set, automatically detected.
batch_size_sint300Batch size in seconds for VAD-segmented audio. Larger values improve throughput at the cost of memory.
store_full_pathboolFalseIf True, store the full audio file path in document metadata. If False, store only the file name.
generation_kwargsOptional[Dict[str, Any]]NoneExtra keyword arguments forwarded to AutoModel.generate(). Use for model-specific options such as use_itn, merge_vad, language, or hotword.

Run Method Parameters

These are the parameters you can configure for the component's run() method. This means you can pass these parameters at query time through the API, in Playground, or when running a job. For details, see Modify Pipeline Parameters at Query Time.

ParameterTypeDefaultDescription
sourcesList[Union[str, Path, ByteStream]]A list of audio file paths or streams to transcribe.
metaOptional[Union[Dict[str, Any], List[Dict[str, Any]]]]NoneMetadata to attach to the produced documents.