Skip to content

swiftraccoon/cpp-sdrtrunk-transcriber

Repository files navigation

C++ SDRTrunk Transcriber

CodeFactorUbuntu CodeQLCMake UbuntuCMake Windows

GitHub tag License issues - cpp-sdrtrunk-transcriber

This project is designed to monitor a directory for SDRTrunk P25 MP3 files, categorize them based on the talkgroup ID, and create transcription files. You have the option to utilize faster-whisper or OpenAI's API for audio transcription and we utilize SQLite3 for database management.

This is not at all tested on Windows. Feel free to file issues for problems with Windows usage if you're open to assisting me debug the problem.

Related Projects

Table of Contents

Features

  • Monitors a directory for new MP3 files
  • Transcribes audio using OpenAI's API or local transcription with faster-whisper
  • Searches transcriptions for tencodes/signals/callsigns in provided JSON files and appends their translation to end of transcription
  • Manages transcriptions and metadata in an SQLite3 database
  • (in progress) Provides a systemd service for automated running

Dependencies

  • CMake
  • ffmpeg
  • SQLite3
  • CURL
  • yaml-cpp

Fedora

  • sudo dnf install ffmpeg ffmpeg-devel libcurl-devel sqlite-devel pkg-config yaml-cpp-devel

Ubuntu

  • sudo apt-get install ffmpeg libavcodec-dev libcurl4-openssl-dev libsqlite3-dev pkg-config libyaml-cpp-dev

Windows

(Please feel free to update this with better steps for Windows users. I do not use Windows so I'm not sure what's necessary.)

Installation

# Clone the repository
git clone https://github.com/swiftraccoon/cpp-sdrtrunk-transcriber.git

# Navigate to the project directory
cd cpp-sdrtrunk-transcriber

# `git clone` external repos that .gitsubmodules will not grab for you
git clone https://github.com/jbeder/yaml-cpp.git external/yaml-cpp
git clone https://github.com/CLIUtils/CLI11.git external/CLI11

# Generate the Makefile
cmake .

# Compile the project
make

Configuration

A sample configuration file is provided (sample-config.yaml). Edit this file to specify the directory to monitor, OpenAI API key, and other settings.

mv sample-config.yaml config.yaml

Usage

Run the compiled binary with the following options:

  • -c, --config <config_path>: Path to the configuration file (Optional, default is ./config.yaml).
  • -l, --local: Set this to enable local transcription via faster-whisper
  • -h, --help: Display help message.

System Service

This is still a TODO. It should work in theory but I've not yet tested it.

A BASH script is provided to show an example template for setting up the binary as a Linux system service.

# Edit install-systemd-service.sh
sudo ./install-systemd-service.sh

faster-whisper Local Transcription

Follow the faster-whisper installation and ensure it's working after.

Once you've confirmed faster-whisper is ready to go, next simply ensure that fasterWhisper.py from the scripts/ folder is in the same folder with the sdrTrunkTranscriber binary.

Now when you launch sdrTrunkTranscriber --local the transcriptions will instead be handled locally via fasterWhisper.py.

SDRTrunk Transcribed Web

Now that you have a folder of processed recordings you can set them up to be displayed within sdrtrunk-transcribed-web.

You just need to copy the:

  • .txt files into the sdrtrunk-transcribed-web/public/transcriptions folder
  • .mp3 files into sdrtrunk-transcribed-web/public/audio folder

An example script for Linux users to do that is in scripts/ of this repo:

(I'll soon enable you to utilize different folders)

Contributing

Feel free to open issues or submit pull requests.

License

This project is licensed under the GPL-3.0 license. See the LICENSE file for details.