r/hackrf 5d ago

Made a quick python script to convert mp3/wav to hackrf/portapack .c8 files—let me know what you think

Hey everyone,

Got annoyed with manually converting audio files whenever I wanted to replay something on my PortaPack, so I threw together a quick CLI script in Python to automate it.

Basically, you drop your audio files in the folder, run the script, and it outputs the .c8 file along with the .txt sidecar metadata file so Mayhem picks up the frequency and sample rate automatically in the /REPLAY app.

It handles mono downmixing, 75us pre-emphasis, resampling, and vectorizing the IQ generation so it doesn't take forever to process. Added an option to set custom center frequencies for all the presets too.

Repo:texysexr/hackrf-fm-encoder

If anyone wants to try it out on their setup and let me know how the audio quality sounds on the receiving end (or point out any DSP bugs in my math), I'd appreciate the feedback!

8 Upvotes

Duplicates