Skip to content

Bridge a USRP audio stream to a Discord voice/stage channel.

License

Notifications You must be signed in to change notification settings

kc1awv/usrp-bridge-discord

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

usrp-bridge-discord

License

Bridge a USRP audio stream to a Discord voice/stage channel.

Getting started

This program is a fork and derived from dmr-bridge-discord

USRP audio streams can come from:

  • MMDVM_CM Tools (USRP2DMR, USRP2M17, USRP2P25, USRP2YSF)
  • URFd Reflector
  • AnalogBridge
  • AllStarLink

Basic Diagram

       127.0.0.1:32001
      <----------------
USRP                     usrp-bridge-discord <--> Discord
      ---------------->
       127.0.0.1:34001

Build

Prerequisites

Ensure Rust and Opus codec development libraries are installed.

Compile

cargo build --release
# or run it directly :
# cargo run

Install

Create a directory for the program binary and environment file

sudo mkdir -p /opt/usrp-bridge-discord

Copy the usrp-bridge-discord binary (found in ./target/release) to /opt/usrp-bridge-discord

sudo cp ./target/release/usrp-bridge-discord /opt/usrp-bridge-discord

Copy the example .env file to /opt/usrp-bridge-discord

sudo cp .env.example /opt/usrp-bridge-discord/.env

Configure

Edit the .env file to reflect your infrastructure :

  • USRP_SEND : IP and port to send audio from Discord to USRP
  • USRP_RECEIVE : IP and port to receive audio from USRP to Discord
  • BOT_TOKEN : see this link to know how to get a token
  • BOT_PREFIX : prefix to add before the bot's commands

Run

Systemctl service

Create a systemd unit file to run the program as a service (/lib/systemd/system/usrp-bridge-discord)

Example:

[Unit]
Description=USRP Bridge to Discord

[Service]
Type=simple
Restart=on-failure
RestartSec=3
WorkingDirectory=/opt/usrp-bridge-discord
ExecStart=/opt/usrp-bridge-discord/usrp-bridge-discord
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process

[Install]
WantedBy=multi-user.target

You may also use Environment directives in the unit file instead of the .env file if you wish.

Caution

It is recommended that you run the service as an unprivileged user and not as root.

Reload systemd and start the service

sudo systemctl daemon-reload
sudo systemctl start usrp-bridge-discord.service
# or enable it at boot:
# systemctl enable usrp-bridge-discord.service

Usage

Here are the bot's commands:

Important

You must be in a voice channel first

  • !join : Make the bot join the channel
  • !leave : Make the bot leave the channel

The bot will join the voice channel that you are in after your type !join.

Make sure to not transmit and receive at the same time, as the stack is half-duplex.

Known Issues

  • Audio from Discord may not work with MMDVM_CM tools, yet. - NEED HELP

Credits

This work is forked and derived from dmr-bridge-discord

Copyright (C) 2022 Jessy SOBREIRO

License

Bridge a USRP audio stream to a Discord voice/stage channel.

Copyright (C) 2024 Steve Miller KC1AWV

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

About

Bridge a USRP audio stream to a Discord voice/stage channel.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages