The Problem: Not Everyone Streams
My daughter and I create a Polish children’s audiobook series — Zwierzęta Detektywi (Animal Detectives). We publish episodes on Spotify and Apple Podcasts, and that works great for most families.
Then one of our customers asked: “Can I get the MP3 files? My kid uses an old MP3 player — no phone, no streaming.”
I love that. Screen time limits, offline listening, no app dependencies. A simple MP3 player for a child makes total sense. So I wanted to support it.
But immediately a second thought followed: if I hand out MP3 files, how do I prevent them from being shared freely across the internet?
Two Layers of Protection
I decided on a two-layer approach:
- Legal — each purchased ZIP includes a
readme.txtwith a clear license: private use only, redistribution is strictly forbidden, with a link to the full license terms. - Technical — each file is invisibly marked with a digital watermark identifying the specific buyer. If a file leaks, I can trace it back.
Metadata tags (ID3) alone aren’t enough for the second layer — anyone can strip them in two seconds. I needed something that survives inside the audio itself.
Enter WavMark
I worked with Claude Sonnet to design the architecture, and the choice for the watermarking layer was WavMark — a deep learning-based audio watermarking framework built specifically for this kind of copyright protection.
How it works:
WavMark encodes 32 bits of data into every 1 second of audio using a neural network encoder. The watermark is completely inaudible — it achieves over 38 dB SNR and a 4.3 PESQ score. To put that in perspective: CD quality is considered acceptable above ~30 dB SNR.
The 32 bits are split:
- 16 bits — fixed identification pattern (confirms the audio is watermarked at all; false positive probability: 1/65536)
- 16 bits — custom payload (in my case: a deterministic hash derived from the buyer’s name + a series prefix)
The same watermark segment is stamped repeatedly across the entire file. Even if someone trims the recording to a short clip, any intact 1-second chunk is enough to recover the watermark and identify the owner.
Most importantly: WavMark survives MP3 compression. It’s trained against 10 types of attacks including Gaussian noise, filtering, resampling, speed changes, and MP3 encoding at 64 kbps. Average bit error rate across those attacks is just 0.48%.
The Pipeline
The processing script (process.py) takes a folder of WAV master files and runs each one through four steps:
1. Embed watermark
WavMark processes the WAV at 16 kHz mono internally, embeds the owner-derived payload, and outputs a watermarked WAV temp file.
2. Convert to MP3
The watermarked WAV is converted to MP3 at 192 kbps using pydub/ffmpeg.
3. Write ID3 tags
Full metadata via mutagen: title, author, album (series name), season, episode number, year, genre, copyright notice, description, license URL, and cover artwork. File is named ZD_S01E01_Title.mp3.
4. Package
All MP3s plus a readme.txt with the license and buyer identification notice get zipped into a single Audiobajki_ZwierzetaDetektywi_BuyerName.zip.
The metadata.json config drives everything — series info, per-episode data, bitrate, and the watermark owner details that get embedded per order.
{
"watermark": {
"owner": "Jan Kowalski",
"contact_email": "[email protected]",
"identifier_prefix": "ZD"
},
"recordings": [
{
"source_file": "1.wav",
"title": "Zaginione marchewki",
"season": 1, "episode": 1,
"date": "10.09.2023",
"description": "...",
"cover_image": "images/1.jpg"
}
]
}
Verification
A separate verify.py script can decode any MP3 and report who it was sold to:
python verify.py output/ZD_S01E01_Zaginione_marchewki.mp3
# → FOUND | owner: Jan Kowalski | payload_id: 42381
WooCommerce Integration
The generated ZIP is uploaded as a downloadable product in WooCommerce. Per-customer generation means each order gets a uniquely watermarked archive. If a file surfaces somewhere it shouldn’t, the watermark payload maps back to the original buyer via a local watermark_registry.json.
Season 1 of Zwierzęta Detektywi is available now:
👉 zwierzetadetektywi.pl — Audiobajki MP3 do pobrania
Built with Python, WavMark, pydub, mutagen, and Claude Sonnet.

