Skip to main content

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

  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Linux/macOS
# or
venv\Scripts\activate  # On Windows
  1. 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
  • -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)
  • -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:

  1. Update the version in pyproject.toml if needed
  2. Commit the changes: git commit -m "Bump version to X.Y.Z"
  3. Create and push a git tag: git tag vX.Y.Z && git push origin vX.Y.Z
  4. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

radio_broadcaster-0.0.2.tar.gz (21.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

radio_broadcaster-0.0.2-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file radio_broadcaster-0.0.2.tar.gz.

File metadata

  • Download URL: radio_broadcaster-0.0.2.tar.gz
  • Upload date:
  • Size: 21.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for radio_broadcaster-0.0.2.tar.gz
Algorithm Hash digest
SHA256 99dae5bc1211c320a1134901144af4ac16028c6780dd29ee5b3bcc48678b09d8
MD5 fcd365972ea0e75afa431039f4638a2d
BLAKE2b-256 746552db986e8a5ac1a8980a5a318cffd0b6cb50f9667532644b6da740d244e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for radio_broadcaster-0.0.2.tar.gz:

Publisher: publish.yml on Yagoor/radio_broadcaster

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file radio_broadcaster-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for radio_broadcaster-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3f55cd01b8cf7479eecc28990ce37cb62b86f1a492922390103683db3f7788ef
MD5 5ab5dd0f24311c054aa8cade97c03312
BLAKE2b-256 af1ab68f7963198a637c6fb7fa405014d9489c193363ce01ee752a734610c893

See more details on using hashes here.

Provenance

The following attestation bundles were made for radio_broadcaster-0.0.2-py3-none-any.whl:

Publisher: publish.yml on Yagoor/radio_broadcaster

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page