Bridge a USRP audio stream to a Discord voice/stage channel.
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
127.0.0.1:32001
<----------------
USRP usrp-bridge-discord <--> Discord
---------------->
127.0.0.1:34001
Ensure Rust and Opus codec development libraries are installed.
cargo build --release
# or run it directly :
# cargo run
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
Edit the .env
file to reflect your infrastructure :
USRP_SEND
: IP and port to send audio from Discord to USRPUSRP_RECEIVE
: IP and port to receive audio from USRP to DiscordBOT_TOKEN
: see this link to know how to get a tokenBOT_PREFIX
: prefix to add before the bot's commands
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
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.
- Audio from Discord may not work with MMDVM_CM tools, yet. - NEED HELP
This work is forked and derived from dmr-bridge-discord
Copyright (C) 2022 Jessy SOBREIRO
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/.