Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/darienmt/radio-listener
Speech Recognition applied to transcribe amateur radio traffic experiments
https://github.com/darienmt/radio-listener
python3 radio-amateurs speach-to-text speech-recognition whisper
Last synced: about 1 month ago
JSON representation
Speech Recognition applied to transcribe amateur radio traffic experiments
- Host: GitHub
- URL: https://github.com/darienmt/radio-listener
- Owner: darienmt
- License: mit
- Created: 2024-11-11T04:49:47.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-11-20T05:25:36.000Z (about 1 month ago)
- Last Synced: 2024-11-20T06:26:50.457Z (about 1 month ago)
- Topics: python3, radio-amateurs, speach-to-text, speech-recognition, whisper
- Language: Python
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# radio-listener
## Overview
This repo contains my experiments with speech recognition applied to transcribe amateur radio traffic. I'm very new to the radio amateur hobby, and I have problems understanding the call signs to be able to call them back or reply to somebody calling me. This project aims to help me see how the hobby works by reading the transcribed traffic and learning.
## Running code
To run the code, install [Virtual Environment](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/), and then run this commands:
```shell
python3 -m venv .venv
. ./.venv/bin/activate
python3 -m pip install -r ./src/requirements.txt
```Then, install [PyAudio](https://people.csail.mit.edu/hubert/pyaudio/):
```shell
sudo apt-get install python-pyaudio python3-pyaudio
sudo apt-get install portaudio19-dev
```Then install [ffmpeg](http://www.ffmpeg.org/) for mp3 support on [pydub](https://github.com/jiaaro/pydub)
```shell
apt-get install ffmpeg libavcodec-extra
```## Code descriptions
- `./src/mic_sample.py`: Use [SpeechRecognition](https://github.com/Uberi/speech_recognition) library to read the computer's microphone(or other input device) and execute the [OpenAI's Whisper model](https://github.com/openai/whisper) to recognize the speech and log it to the screen(`std`).
```shell
python ./src/mic_sample.py
```- `./src/mic_reproduction.py`: This is an attempt to reproduce the audio input on the speaker in real-time (not very successful) with [PyAudio](https://people.csail.mit.edu/hubert/pyaudio/) and a couple of threads and queues. It will ask to select the input and output device and start listening and reproducing.
```shell
python ./src/mic_reproduction.py
```- `./src/select_input.py`: This function selects an input or output device from the local hardware with [PyAudio](https://people.csail.mit.edu/hubert/pyaudio/). It is used in most of the other files, as all of them need this selection.
- `./src/mic_writer.py`: This is the first one actually doing some interesting job. It listens to an audio input(using [SpeechRecognition](https://github.com/Uberi/speech_recognition)), recognizes the speech using [OpenAI's Whisper model](https://github.com/openai/whisper) `medium` model, and writes to the `std` and a file(`./.logs`).
```shell
# It will ask to select an input device
python ./src/mic_writer.py# Or you can preselect the device index(believe me, you will remember it after a while...)
python ./src/mic_writer.py --device-index 9
```- `./src/mic_writer_whisper.py`: More or less like `./src/mic_writer.py`, but this time it is using [OpenAI's Whisper model](https://github.com/openai/whisper) `medium` model directly and writing the audio as mp3 at `./.audio/{yyyy-mm-dd}/*.mp3`.
```shell
# It will ask to select an input device
python ./src/mic_writer_whisper.py# Or you can preselect the device index
python ./src/mic_writer_whisper.py --device-index 9
```## Development
### Create venv and install dependencies
```shell
python3 -m venv .venv
. ./.venv/bin/activate
python3 -m pip install -r ./src/requirements.txt
```### Update Dependencies
```shell
python3 -m venv .venv
. ./.venv/bin/activate
python3 -m pip freeze > ./src/requirements.txt```