A CLI application for radio broadcasting
Project description
Radio Broadcaster
Broadcast internet radio streams over Bluetooth LE Audio (Auracast) using Python. This tool allows you to stream audio from any HTTP/HTTPS audio source to Bluetooth LE Audio receivers with support for custom manufacturer data and encryption.
Features
- Stream internet radio over Bluetooth LE Audio (Auracast)
- Support for custom manufacturer-specific data in BLE advertising
- Optional broadcast encryption
- Customizable broadcast name
- Verbose logging for debugging
- Pure Python implementation using PyAV and Bumble
Requirements
- Python 3.12+
- Bluetooth LE Audio compatible interface (USB Bluetooth adapter or serial connection)
- Internet connection for radio stream
Tested Hardware
This project is tested with the hci_uart_bumble controller which provides a serial-based HCI interface for Bluetooth LE Audio.
Note: While other controllers may work, we only test and recommend the hci_uart_bumble controller. Other controllers are not tested against this project.
Installation
Development Setup
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Linux/macOS
# or
venv\Scripts\activate # On Windows
- Install the package in editable mode with dev dependencies:
pip install -e ".[dev]"
Production Install
pip install .
Usage
# Show help
radio-broadcaster --help
# Show version
radio-broadcaster --version
# Broadcast a radio stream
radio-broadcaster <URL>
# Broadcast with custom name
radio-broadcaster <URL> -n "My Station"
# Broadcast with encryption
radio-broadcaster <URL> -c "my-password"
# Broadcast with manufacturer data (example: Nordic Semiconductor)
radio-broadcaster <URL> --manufacturer-data 0x0059:010203
# Broadcast with verbose output
radio-broadcaster <URL> --verbose
# Broadcast with custom transport (serial port)
radio-broadcaster <URL> -t "serial:/dev/ttyACM0,1000000"
Options
-t, --transport SPEC: Bumble transport specifier (default: usb:0)- Examples:
usb:0,hci:0,serial:/dev/ttyACM0,1000000
- Examples:
-n, --name NAME: Broadcast name visible to receivers (default: "Radio Broadcaster")-c, --code PASSWORD: Encryption password (max 16 characters)--manufacturer-data COMPANY_ID:HEX_DATA: Manufacturer-specific data (can be used multiple times)- Example:
0x0059:010203(Nordic Semiconductor with data 01 02 03)
- Example:
-v, --verbose: Enable verbose output-V, --version: Show version information and exit
Development
Continuous Integration
This project uses GitHub Actions to automatically run quality checks on all pushes and pull requests:
- Tests: Runs all pytest tests
- Type Checking: Verifies type annotations with mypy
- Code Formatting: Checks code style with black
- Linting: Runs ruff for code quality
All checks must pass before merging to main or develop branches.
Releases and PyPI Publishing
Releases are automatically published to PyPI when you create a GitHub release or push a tag matching v* (e.g., v1.0.0). The publishing workflow uses PyPI's Trusted Publishers feature, which authenticates via GitHub's OIDC token without requiring stored secrets.
To create a release:
- Update the version in
pyproject.tomlif needed - Commit the changes:
git commit -m "Bump version to X.Y.Z" - Create and push a git tag:
git tag vX.Y.Z && git push origin vX.Y.Z - The GitHub Actions workflow automatically builds and publishes the package to PyPI
The package will be available at https://pypi.org/project/radio-broadcaster/
Running Tests
pytest
Code Formatting
black src tests
Linting
ruff check src tests
Type Checking
mypy src
License
Apache License 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file radio_broadcaster-0.0.1.tar.gz.
File metadata
- Download URL: radio_broadcaster-0.0.1.tar.gz
- Upload date:
- Size: 21.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c906a4478e07c8799b3d67ebb2e03484c1872651d9ae3a81001070e6972139d
|
|
| MD5 |
f74005914828fb75c4e177e9e4aa2f9c
|
|
| BLAKE2b-256 |
ac08bba53bbaca9b07f1fcc0a28c8aaaa64389e8565c115271f30d8e0fd70836
|
Provenance
The following attestation bundles were made for radio_broadcaster-0.0.1.tar.gz:
Publisher:
publish.yml on Yagoor/radio_broadcaster
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
radio_broadcaster-0.0.1.tar.gz -
Subject digest:
0c906a4478e07c8799b3d67ebb2e03484c1872651d9ae3a81001070e6972139d - Sigstore transparency entry: 1339552730
- Sigstore integration time:
-
Permalink:
Yagoor/radio_broadcaster@73b3e140bf39dc8d2ae6963e99c6c1d5d675f1e8 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/Yagoor
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@73b3e140bf39dc8d2ae6963e99c6c1d5d675f1e8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file radio_broadcaster-0.0.1-py3-none-any.whl.
File metadata
- Download URL: radio_broadcaster-0.0.1-py3-none-any.whl
- Upload date:
- Size: 15.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2179dba676e5a93ceadd93da0c77ac057cd185fa1ddcf6a744f18f804b197b5c
|
|
| MD5 |
b3338603949c9849cd90578817a05258
|
|
| BLAKE2b-256 |
5fa30f52771c9948cd559adca6acd9a43938412c5bf70b58910ec058f30261ec
|
Provenance
The following attestation bundles were made for radio_broadcaster-0.0.1-py3-none-any.whl:
Publisher:
publish.yml on Yagoor/radio_broadcaster
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
radio_broadcaster-0.0.1-py3-none-any.whl -
Subject digest:
2179dba676e5a93ceadd93da0c77ac057cd185fa1ddcf6a744f18f804b197b5c - Sigstore transparency entry: 1339552741
- Sigstore integration time:
-
Permalink:
Yagoor/radio_broadcaster@73b3e140bf39dc8d2ae6963e99c6c1d5d675f1e8 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/Yagoor
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@73b3e140bf39dc8d2ae6963e99c6c1d5d675f1e8 -
Trigger Event:
push
-
Statement type: