---
title: "FallbackSTT | Micdrop"
description: "The FallbackSTT class provides automatic failover between multiple STT providers for improved reliability."
url: "https://micdrop.dev/docs/ai-integration/fallback-strategies/stt-fallback"
---

*   [Getting Started](/docs/getting-started)
*   [Client (Browser)](/docs/client)
    
    *   [Installation](/docs/client/installation)
    *   [React Hooks](/docs/client/react-hooks)
    *   [Start/Stop Call](/docs/client/start-stop-call)
    *   [Pause/Resume Call](/docs/client/pause-resume-call)
    *   [Mute/Unmute Call](/docs/client/mute-unmute-call)
    *   [Call State](/docs/client/call-state)
    *   [Display Conversation Messages](/docs/client/display-conversation-messages)
    *   [Handling Tool Calls](/docs/client/handling-tool-calls)
    *   [Device Management](/docs/client/devices-management)
    *   [Voice Activity Detection (VAD)](/docs/client/vad)
    *   [Error Handling](/docs/client/error-handling)
    *   Utility Classes
        
        *   [Mic](/docs/client/utility-classes/mic)
        *   [MicdropClient](/docs/client/utility-classes/micdrop-client)
        *   [MicRecorder](/docs/client/utility-classes/mic-recorder)
        *   [Speaker](/docs/client/utility-classes/speaker)
        
    
*   [Client (React Native)](/docs/react-native)
    
    *   [Installation](/docs/react-native/installation)
    *   [Hooks and Call State](/docs/react-native/hooks)
    *   [Audio Output and Devices](/docs/react-native/audio-output)
    *   [Voice Activity Detection (VAD)](/docs/react-native/vad)
    *   [Using Another Audio Library](/docs/react-native/custom-audio)
    
*   [Server (Node.js)](/docs/server)
    
    *   [Installation](/docs/server/installation)
    *   [With Fastify](/docs/server/with-fastify)
    *   [With NestJS](/docs/server/with-nestjs)
    *   [Auth and Parameters](/docs/server/auth-and-parameters)
    *   [First Message](/docs/server/first-message)
    *   [Save Messages](/docs/server/save-messages)
    *   [Resume a Conversation](/docs/server/resume-conversation)
    *   [Recording Audio](/docs/server/recording-audio)
    *   [Error Handling](/docs/server/error-handling)
    *   [Tools](/docs/server/tools)
    *   [Extract Value from Answer](/docs/server/extract)
    *   [Auto End Call](/docs/server/auto-end-call)
    *   [Semantic Turn Detection](/docs/server/semantic-turn-detection)
    *   [Noise Filtering](/docs/server/noise-filtering)
    *   [Micdrop Protocol](/docs/server/protocol)
    
*   [AI Integrations](/docs/ai-integration)
    
    *   Provided Integrations
        
        *   [AI SDK](/docs/ai-integration/provided-integrations/ai-sdk)
        *   [Cartesia](/docs/ai-integration/provided-integrations/cartesia)
        *   [ElevenLabs](/docs/ai-integration/provided-integrations/elevenlabs)
        *   [Gladia](/docs/ai-integration/provided-integrations/gladia)
        *   [Gradium](/docs/ai-integration/provided-integrations/gradium)
        *   [Kokoro](/docs/ai-integration/provided-integrations/kokoro)
        *   [Mistral](/docs/ai-integration/provided-integrations/mistral)
        *   [OpenAI](/docs/ai-integration/provided-integrations/openai)
        *   [Piper](/docs/ai-integration/provided-integrations/piper)
        *   [Pocket TTS](/docs/ai-integration/provided-integrations/pocket-tts)
        *   [Whisper](/docs/ai-integration/provided-integrations/whisper)
        
    *   Custom Integrations
        
        *   [Agent (LLM)](/docs/ai-integration/custom-integrations/custom-agent)
        *   [Speech-to-Text (STT)](/docs/ai-integration/custom-integrations/custom-stt)
        *   [Text-to-Speech (TTS)](/docs/ai-integration/custom-integrations/custom-tts)
        
    *   Fallback Strategies
        
        *   [FallbackAgent](/docs/ai-integration/fallback-strategies/agent-fallback)
        *   [FallbackSTT](/docs/ai-integration/fallback-strategies/stt-fallback)
        *   [FallbackTTS](/docs/ai-integration/fallback-strategies/tts-fallback)
        
    *   [Local Models](/docs/ai-integration/local-models)
        
        *   [Choosing the Models](/docs/ai-integration/local-models/choosing-models)
        *   [Latency and Memory](/docs/ai-integration/local-models/performance)
        *   [Explorations](/docs/ai-integration/local-models/explorations)
        
    *   [IA Vocale Souveraine 🇫🇷🇪🇺](/docs/ai-integration/sovereign-voice-ai)
    
*   [Migration](/docs/migration)
    
    *   [Upgrade to v3](/docs/migration/v3)
    

[Micdrop](/) › [Documentation](/docs/getting-started)

# FallbackSTT

The `FallbackSTT` class provides automatic failover between multiple STT providers for improved reliability. When one provider fails after exhausting its retries, it automatically switches to the next provider in the list.

## Features

*   **Automatic failover**: Seamlessly switches between providers when failures occur
*   **Audio buffering**: Retains audio chunks during failures and replays them to the next provider
*   **Circular rotation**: Cycles through providers indefinitely until transcription succeeds
*   **Zero configuration**: Works with any STT implementation

## Usage

```
import { FallbackSTT } from '@micdrop/server'import { OpenaiSTT } from '@micdrop/openai'import { GladiaSTT } from '@micdrop/gladia'
// Create a fallback STT with multiple providersconst stt = new FallbackSTT({  factories: [    // Primary provider: OpenAI with low retry count    () =>      new OpenaiSTT({        apiKey: process.env.OPENAI_API_KEY || '',        maxRetry: 2, // Fail faster to switch to backup      }),    // Backup provider: Gladia    () =>      new GladiaSTT({        apiKey: process.env.GLADIA_API_KEY || '',        maxRetry: 3,      }),  ],})
// Use with MicdropServerconst server = new MicdropServer(socket, {  stt,  // ... other options})
```

## Options

Option

Type

Description

`factories`

`Array<() => STT>`

Array of factory functions that create STT instances

## How It Works

1.  **Initialization**: Starts with the first provider in the list
2.  **Normal operation**: Forwards all audio to the current provider and emits transcripts
3.  **On failure**: When a provider emits the `Failed` event:
    *   Destroys the current provider
    *   Moves to the next provider (wraps around to first if at end)
    *   Replays buffered audio chunks to the new provider
4.  **Logging**: Inherits logger configuration and applies it to child providers

[Previous← FallbackAgent](/docs/ai-integration/fallback-strategies/agent-fallback)[NextFallbackTTS →](/docs/ai-integration/fallback-strategies/tts-fallback)

On this page

*   [Features](#features)
*   [Usage](#usage)
*   [Options](#options)
*   [How It Works](#how-it-works)
