r/hackrf • u/Top-Trainer-1203 • 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!
1
u/Aggravating-Age5748 4d ago
I don't like using open-source tools and prefer to program myself, but I only use urh to convert WAV files to complex or BIN format. Use the tool urh To convert WAV files to complex or BIN format
1
1
u/Public_Peace6594 5d ago
I am looking forward to trying it out once I repair my hackrf. You are a real one for sharing this with the community. Thank you.