Skip to content

API Reference parrot.voice.transcriber.faster_whisper_backend

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.voice.transcriber.faster_whisper_backend

View source

Faster Whisper Backend for Voice Transcription.

Local GPU-accelerated transcription backend using the faster-whisper library. This is the default backend for voice transcription, offering low latency and no API costs.

Originally part of FEAT-008 (MS Teams Voice Note Support), refactored to shared location for FEAT-039.

Alias AbstractTranscriberBackend

Re-exported from parrot.voice.transcriber.backend.AbstractTranscriberBackend.

Class FasterWhisperBackend

Local GPU-accelerated transcription using Faster Whisper.

The model is loaded lazily on first transcription to save GPU memory. Call close() to release the model when done.

Example::

backend = FasterWhisperBackend(model_size="small")
try:
    result = await backend.transcribe(Path("/path/to/audio.ogg"))
    print(f"Transcription: {result.text}")
finally:
    await backend.close()  # Release GPU memory
Parameter Type Default Description
model_size str 'small' Whisper model size. Options: "tiny", "base", "small", "medium", "large-v3". Larger models are more accurate but slower. Default: "small" (good balance of speed and accuracy).
device str 'cuda' Device to run on. Options: "cuda", "cpu", "auto". Default: "cuda" for GPU acceleration.
compute_type str 'float16' Precision for computation. Options: "float16", "int8", "float32". Default: "float16" for GPU (fastest with good accuracy).

Method FasterWhisperBackend.transcribe

Transcribe audio file to text using Faster Whisper.

transcribe(audio_path: Path, language: Optional[str] = None) -> TranscriptionResult

Parameter Type Default Description
audio_path Path Path to the audio file to transcribe. Supported formats: WAV, OGG, MP3, M4A, WebM.
language Optional[str] None Optional language hint (ISO 639-1 code, e.g., "en", "es"). A BCP-47 tag ("es-ES") is reduced to its primary subtag, the only form Whisper accepts. If None, the language is auto-detected.

Returns: TranscriptionResult — TranscriptionResult containing the transcribed text, detected language, audio duration, confidence score, and processing time.

Raises:

  • FileNotFoundError — If the audio file does not exist.
  • RuntimeError — If transcription fails.

Method FasterWhisperBackend.close

Release the model and free GPU memory.

This method should be called when the backend is no longer needed to free up GPU memory. After calling close(), the model will be reloaded on the next transcription request.

close() -> None

Alias TranscriptionResult

Re-exported from parrot.voice.transcriber.models.TranscriptionResult.

Alias primary_language_subtag

Re-exported from parrot.voice.transcriber.backend.primary_language_subtag.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally