Occasionally some audio recording devices stamp files with the wrong samplerate despite the underlying audio being recorded as intended (an example being Grace Design m108 on MacOS with firmware prior to 1.12). As a result, DAWs and audio players play back the files at the wrong speed. This python script is designed to quickly fix these issues for one or more audio files by only changing the samplerate information in the wave header.
Supported file type: wav
If you don't have the script set as executable or if you're on Windows, run the script using Python:
python sample-right.py <correct_samplerate> <file_pattern>
On Unix-based systems (MacOS/Linux), if you have the script as executable, you can run it directly:
chmod +x sample-right.py
./sample-right.py <correct_samplerate> <file_pattern>
./sample-right.py 88200 *.wav
./sample-right-gui.py
Included in the repository is a wave file (from The Open Goldberg Variations performed by Kimiko Ishizaka) with audio samples recorded at 44.1k but incorrectly stamped 48k. To fix:
./sample-right.py 44100 goldberg-test.wav