2023-05-30 11:48:32 +05:30
2023-05-30 11:31:28 +05:30
2023-05-26 03:08:29 +08:00
2023-05-05 18:27:01 +08:00
2023-05-30 11:48:32 +05:30
2023-05-26 03:22:19 +08:00
2023-05-05 18:27:01 +08:00
2023-05-26 03:08:29 +08:00

whisper-live

A nearly-live implementation of OpenAI's Whisper.

This project is a real-time transcription application that uses the OpenAI Whisper model to convert speech input into text output. It can be used to transcribe both live audio input from microphone and pre-recorded audio files.

Unlike traditional speech recognition systems that rely on continuous audio streaming, we use voice activity detection (VAD) to detect the presence of speech and only send the audio data to whisper when speech is detected. This helps to reduce the amount of data sent to the API and improves the accuracy of the transcription output.

Installation

  • Install PyAudio and ffmpeg
 bash setup.sh
  • To install client requirements
 pip install -r requirements/client.txt
  • To install server requirements
 pip install -r requirements/server.txt

Getting Started

  • Run the server
 python server.py
  • On the client side

    • To transcribe an audio file:
     python client.py --audio "audio.wav"
    
    • To transcribe from microphone:
     python client.py
    

Transcribe audio from browser

  • Run the websocket-server
 python websocket_server.py

This would start the websocket server on port 9090.

  • Head over to Audio-Transcription module to unpack and load a chrome extension to capture any audio in the browser(only Chrome for now) and send it to the websocket server to transcribe the audio in the current tab.

Future Work

  • Update Documentation.
  • Keep only a single server implementation i.e. websockets and get rid of the socket implementation in server.py. Also, update client.py to websockets-client implemenation.
  • Add translation to other languages on top of transcription.

Citations

@article{Whisper
  title = {Robust Speech Recognition via Large-Scale Weak Supervision},
  url = {https://arxiv.org/abs/2212.04356},
  author = {Radford, Alec and Kim, Jong Wook and Xu, Tao and Brockman, Greg and McLeavey, Christine and Sutskever, Ilya},
  publisher = {arXiv},  
  year = {2022},
}
@misc{Silero VAD,
  author = {Silero Team},
  title = {Silero VAD: pre-trained enterprise-grade Voice Activity Detector (VAD), Number Detector and Language Classifier},
  year = {2021},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/snakers4/silero-vad}},
  commit = {insert_some_commit_here},
  email = {hello@silero.ai}
}
Languages
Python 79.2%
JavaScript 11.9%
Swift 4.8%
HTML 2.5%
Shell 1.1%
Other 0.5%