explaingit

texysexr/hackrf-fm-encoder

Analysis updated 2026-07-24

0PythonAudience · generalComplexity · 2/5LicenseSetup · moderate

TLDR

A Python tool that converts audio files like MP3 and WAV into FM radio signal files for HackRF One and PortaPack devices. Pick a file, choose a quality preset, and it generates a ready-to-play radio signal file.

Mindmap

mindmap
  root((repo))
    What it does
      Converts audio to FM radio files
      Works with HackRF and PortaPack
      Supports MP3 WAV FLAC M4A
    How it works
      Normalizes volume and audio
      Applies FM pre-emphasis filtering
      Outputs c8 and txt files
    Presets
      Standard FM Broadcast 500 kHz
      High Fidelity 1 MHz
      Low Storage 250 kHz
    Tech stack
      Python and NumPy and SciPy
      FFmpeg for audio conversion
      Rich for terminal interface
    Audience
      Radio enthusiasts
      HackRF PortaPack owners
      Vibe coders

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Convert your favorite music into FM radio files for playback on a PortaPack device.

USE CASE 2

Create low-storage radio signal files to fit more audio on a small SD card.

USE CASE 3

Generate high-fidelity FM broadcast files for the best possible sound quality.

USE CASE 4

Prepare custom FM radio transmissions at a specific frequency using HackRF One.

What is it built with?

PythonNumPySciPyFFmpegRich

How does it compare?

texysexr/hackrf-fm-encoder0xallam/my-recipe0xhassaan/nn-from-scratch
Stars00
LanguagePythonPythonPython
Last pushed2022-11-22
MaintenanceDormant
Setup difficultymoderatemoderatemoderate
Complexity2/52/54/5
Audiencegeneralgeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires Python 3.8+ and a separate installation of FFmpeg on your computer.

Use this software freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

This repository provides a command-line tool that converts ordinary audio files into a special format used by HackRF One and PortaPack radio devices. These devices can transmit radio signals, and the tool prepares audio so it can be played back as FM radio through that hardware. Supported input formats include MP3, WAV, FLAC, and M4A. The tool runs on Python and relies on a few helper programs. NumPy and SciPy handle the math involved in turning sound into radio signal data. Rich provides a clean interface in the terminal. FFmpeg, a separate program you install on your computer, handles the initial audio conversion when needed. You also need Python 3.8 or newer, and the tool works on Windows, Linux, and macOS. Using it is straightforward. You place your audio files in the same folder as the script and run it. The tool shows a list of your audio files and asks you to pick one. Then you choose from four presets: PortaPack FM Broadcast at 500 kHz for most users, High Fidelity at 1 MHz for best quality, Low Storage at 250 kHz for smaller files, or a fully custom option. You enter a center frequency in megahertz and a name for the output file. The tool then processes the audio through several steps. It converts the file to WAV if needed, normalizes the volume, applies FM pre-emphasis filtering for better sound quality, resamples the audio, and generates the radio signal data. It saves a .c8 file containing that data and a .txt file with metadata the PortaPack device needs, including the frequency and sample rate you chose. To play the result on a PortaPack, you copy both files to the SD card and select the .c8 file from the Replay app. If you are using a HackRF directly, the tool prints the exact command you need to run for playback. The project is open source under the MIT License and welcomes contributions.

Copy-paste prompts

Prompt 1
I have a PortaPack with HackRF One. How do I convert my MP3 music files into FM radio files I can play on the device?
Prompt 2
Help me install the hackrf-fm-encoder Python tool and its dependencies like FFmpeg on my computer so I can start converting audio to radio signal files.
Prompt 3
What is the difference between the 500 kHz, 1 MHz, and 250 kHz FM presets in this tool, and which one should I choose for my PortaPack?
Prompt 4
Walk me through choosing a custom frequency and sample rate in hackrf-fm-encoder to transmit on a specific FM channel.

Frequently asked questions

What is hackrf-fm-encoder?

A Python tool that converts audio files like MP3 and WAV into FM radio signal files for HackRF One and PortaPack devices. Pick a file, choose a quality preset, and it generates a ready-to-play radio signal file.

What language is hackrf-fm-encoder written in?

Mainly Python. The stack also includes Python, NumPy, SciPy.

What license does hackrf-fm-encoder use?

Use this software freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is hackrf-fm-encoder to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is hackrf-fm-encoder for?

Mainly general.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.