Coder Social home page Coder Social logo

wired247 / audio-stream-transcription-monitoring-and-alerting Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mc51/audio-stream-transcription-monitoring-and-alerting

0.0 0.0 0.0 6 KB

Transcribe a live audio-stream in near real time using OpenAI-Whisper. Monitor it for keywords and trigger alarm to Signal messenger

Shell 1.72% Python 98.28%

audio-stream-transcription-monitoring-and-alerting's Introduction

What?

Transcribe an audio-stream in almost real time using OpenAI-Whisper. Monitor it for specific terms in the transcribed text using fuzzy-matching. Trigger an alarm via Signal messenger when your terms are mentioned.

How?

Run pip install -r requirements.txt to resolve dependencies.

Consists of three parts:

  1. save_stream.py saves .mp3 files in chunks of 30sec from an audio stream
  2. transcribe.py transcribes each incoming audio chunk using OpenAI-Whisper. Then, it uses fuzzy matching to monitor the spoken word for specific terms. On match, it calls msg_group_via_signal.sh
  3. msg_group_via_signal.sh relays the alarm message to the signal-cli tool which messages a group on the Signal messenger

Take a look at the files to configure them. For example, you can set durations during which the stream is monitored. Per default the small OpenAI-Whisper model is used. Thus, the transcription quality is decent but not perfect. Hence, we use fuzzy-matching to monitor for our terms, so that we reduce false-negatives (but increase false-positive) alarms. The benefit of the small model being that it works in almost real-time even on a CPU-only machine with mediocre specs (on AWS a c5a.large EC2 instance is sufficient). There will be some delay because of the 30sec chunks and because inference takes some time, but it's fast enough to process all audio without falling behind. With better specs / GPU you can increase model size for better quality transcriptions or reduce latency.

Why?

My very specific use case: My sports team participated in a contest hosted by a local radio station that went on for a couple of weeks. If the name of our team was mentioned on-air, we had a couple of minutes to call the radio station in order to win a prize. This was my alternative to listening to shitty music.

audio-stream-transcription-monitoring-and-alerting's People

Contributors

mc51 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.