Skip to content

Instantly share code, notes, and snippets.

@jviall
Last active June 9, 2026 06:40
Show Gist options
  • Select an option

  • Save jviall/18107ca35e0e7f38cf02ba50e3b9cc77 to your computer and use it in GitHub Desktop.

Select an option

Save jviall/18107ca35e0e7f38cf02ba50e3b9cc77 to your computer and use it in GitHub Desktop.
rekordbox-edit: e2e audio fixture generation

rekordbox-edit e2e audio fixtures — generation and authoring guide

This gist holds the off-repo material used to produce the audio fixtures and master.db files for the rekordbox-edit end-to-end suite. The audio files themselves live in the repo under tests/e2e/fixtures/audio/.

Filename convention

NN-<codec>-<rate>-<depth-or-bitrate>[-encmode].<ext>

Codec stays in the filename even when the extension is unambiguous, so the convention is uniform and disambiguates ALAC vs AAC inside .m4a. 44_1k uses underscore so the dot doesn't fight extension parsing.

Regenerating the audio fixtures

Only required if you need to rebuild the fixtures from scratch (e.g. the spec changes). The committed .flac/.m4a/.aiff/.wav/.mp3 files are the source of truth.

MacOS

brew install ffmpeg
curl -fsSL https://gist.githubusercontent.com/jviall/18107ca35e0e7f38cf02ba50e3b9cc77/raw/generate.sh -o generate.sh
chmod +x generate.sh
./generate.sh path/to/rekordbox-edit/tests/e2e/fixtures/audio

Windows

winget install Gyan.FFmpeg

Invoke-WebRequest -Uri "https://gist.githubusercontent.com/jviall/18107ca35e0e7f38cf02ba50e3b9cc77/raw/generate.sh" -OutFile "generate.sh"

Set-Content -Path "generate.sh" -Value (Get-Content "generate.sh" -Raw | Out-String)
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

& .\generate.sh "path\to\rekordbox-edit\tests\e2e\fixtures\audio"

Verify each file with ffprobe -v error -show_streams <file> and confirm the codec / sample rate / bit depth against the fixture library table below before committing.

Fixture library (10 tracks)

# Filename Codec Rate / depth or bitrate Title Artist Album
1 01-flac-44_1k-16b.flac flac 44.1 kHz / 16-bit Wave Alpha Alpha Lossless Vol 1
2 02-flac-96k-24b.flac flac 96 kHz / 24-bit Wave Beta Beta Lossless Vol 1
3 03-alac-44_1k-16b.m4a alac 44.1 kHz / 16-bit Apple Alpha Alpha Apple Lossless
4 04-alac-48k-24b.m4a alac 48 kHz / 24-bit Apple Beta Beta Apple Lossless
5 05-aiff-44_1k-16b.aiff pcm_s16be 44.1 kHz / 16-bit Interchange Gamma AIFF Sampler
6 06-wav-96k-24b.wav pcm_s24le 96 kHz / 24-bit Studio Master Delta WAV Masters
7 07-mp3-44_1k-320cbr.mp3 mp3 44.1 kHz / 320 kbps CBR High Quality Epsilon Compressed
8 08-mp3-44_1k-v0vbr.mp3 mp3 44.1 kHz / V0 VBR Variable Rate Zeta Compressed
9 09-aac-44_1k-256kbps.m4a aac 44.1 kHz / 256 kbps Modern Lossy Eta AAC Collection
10 10-üñîcödé-flac-44_1k-16b.flac flac 44.1 kHz / 16-bit Üñîcödé Mañana Théta (blank)

Authoring a fresh master.db in Rekordbox

Run once per target OS (macOS and Windows are independent; either order).

  1. Start with a clean Rekordbox installation (see How to do a clean uninstall of Rekordbox).
  2. Remove all files from the default library, delete all playlists.
  3. Stage the audio at the canonical path:
    • macOS: mkdir -p /tmp/rbedit-e2e/music && cp <repo>/tests/e2e/fixtures/audio/* /tmp/rbedit-e2e/music/
    • Windows: mkdir C:\rbedit-e2e\music; copy <repo>\tests\e2e\fixtures\audio\* C:\rbedit-e2e\music\
  4. Launch Rekordbox. Import the folder. Confirm all 10 tracks land with metadata per the table above; manually fix any field Rekordbox failed to read from the file tags.
  5. Build two playlists:
    • Lossless Only — tracks 1–6.
    • Compressed — tracks 7, 8, 9.
  6. Save and quit Rekordbox.
  7. Copy the resulting DB into the repo, embedding the rekordbox version in the database filename. e.g.:
    • macOS: cp "$HOME/Library/Application Support/Pioneer/rekordbox6/master.db" <repo>/tests/e2e/fixtures/macos/master.6.8.6.db or cp "$HOME/Library/Pioneer/rekordbox/master.6.8.6.db" <repo>/tests/e2e/fixtures/macos/master.db
    • Windows: Copy-Item "$env:AppData\Roaming\Pioneer\rekordbox\master.db" <repo>\tests\e2e\fixtures\windows\master.7.2.1.db
  8. Capture the DjmdContent.ID values for track 1 (convert source) and track 10 (edit target) and include them in the PR body:
    uv run rekordbox-edit search --database-path <repo>/tests/e2e/fixtures/macos/master.db --print json | jq '.tracks[] | {ID, Title}'
  9. Commit master.db in a single PR per OS.
#!/usr/bin/env bash
# rekordbox-edit e2e audio fixture generator.
#
# Synthesizes the 10 fixture audio files used by the rekordbox-edit e2e suite
# from deterministic sine waves.
#
# Usage:
# ./generate.sh [output-dir]
#
# Requires ffmpeg and ffprobe in PATH
set -euo pipefail
out=${1:-.}
mkdir -p "$out"
gen() {
local freq=$1
shift
ffmpeg -y -hide_banner -loglevel error \
-f lavfi -i "sine=frequency=${freq}:duration=2" \
"$@"
}
gen 440 -ar 44100 -sample_fmt s16 \
-metadata artist=Alpha -metadata title="Wave Alpha" -metadata album="Lossless Vol 1" \
"$out/01-flac-44_1k-16b.flac"
gen 523 -ar 96000 -sample_fmt s32 \
-metadata artist=Beta -metadata title="Wave Beta" -metadata album="Lossless Vol 1" \
"$out/02-flac-96k-24b.flac"
gen 659 -ar 44100 -sample_fmt s16p -c:a alac \
-metadata artist=Alpha -metadata title="Apple Alpha" -metadata album="Apple Lossless" \
"$out/03-alac-44_1k-16b.m4a"
gen 698 -ar 48000 -sample_fmt s32p -c:a alac \
-metadata artist=Beta -metadata title="Apple Beta" -metadata album="Apple Lossless" \
"$out/04-alac-48k-24b.m4a"
gen 784 -ar 44100 -sample_fmt s16 \
-metadata artist=Gamma -metadata title=Interchange -metadata album="AIFF Sampler" \
"$out/05-aiff-44_1k-16b.aiff"
gen 880 -ar 96000 -c:a pcm_s24le \
-metadata artist=Delta -metadata title="Studio Master" -metadata album="WAV Masters" \
"$out/06-wav-96k-24b.wav"
gen 988 -ar 44100 -c:a libmp3lame -b:a 320k \
-metadata artist=Epsilon -metadata title="High Quality" -metadata album=Compressed \
"$out/07-mp3-44_1k-320cbr.mp3"
gen 1047 -ar 44100 -c:a libmp3lame -q:a 0 \
-metadata artist=Zeta -metadata title="Variable Rate" -metadata album=Compressed \
"$out/08-mp3-44_1k-v0vbr.mp3"
gen 1175 -ar 44100 -c:a aac -b:a 256k \
-metadata artist=Eta -metadata title="Modern Lossy" -metadata album="AAC Collection" \
"$out/09-aac-44_1k-256kbps.m4a"
gen 1319 -ar 44100 -sample_fmt s16 \
-metadata artist=Théta -metadata title="Üñîcödé Mañana" \
"$out/10-üñîcödé-flac-44_1k-16b.flac"
echo "Generated 10 fixture files in $out"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment