alesaccoia/VoiceStreamAI

Near-Realtime audio transcription using self-hosted Whisper and WebSocket in Python/JS

What it solves

VoiceStreamAI provides a way to perform near-real-time audio transcription by streaming audio from a web browser to a server. It addresses the challenge of processing continuous audio streams efficiently by using Voice Activity Detection (VAD) to ensure only actual speech is transcribed, reducing computational load and network bandwidth.

How it works

The system consists of a Python-based server and a JavaScript client that communicate via WebSockets. The client captures audio and sends it in chunks to the server. The server uses a modular pipeline to process this audio:

  1. Voice Activity Detection (VAD): Using models like Silero or Pyannote, the server identifies segments of the audio that contain speech.
  2. Transcription: The system uses Automatic Speech Recognition (ASR) models, defaulting to faster-whisper (a high-performance version of OpenAI's Whisper), to convert the detected speech into text.
  3. Buffering Strategy: To prevent words from being cut off at chunk boundaries, the system employs a "SilenceAtEndOfChunk" strategy, which waits for a pause in speech before triggering transcription.

Who it’s for

Developers looking to build applications that require real-time speech-to-text capabilities with a flexible, modular architecture that allows for swapping different VAD and ASR models.

Highlights

  • Modular Design: Uses factory and strategy patterns to easily integrate new VAD and ASR technologies.
  • Real-time Streaming: Leverages WebSockets for low-latency communication between the client and server.
  • Efficient Processing: VAD integration minimizes the processing of non-speech audio, saving GPU/CPU resources.
  • Customizable: Clients can dynamically configure language, chunk length, and processing strategies via JSON messages.

Related

  • Project
  • Project
  • Project
  • Project
  • Project