Skip to content

Python script to batch fix incorrect samplerate header information

License

Notifications You must be signed in to change notification settings

chmaha/sample-right

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample-Right - Batch fix incorrect samplerate header information


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

Usage:

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>

Example (correcting the samplerate header information for all wav files in the folder to 88.2k):

./sample-right.py 88200 *.wav

GUI version

./sample-right-gui.py

image

Test File

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

About

Python script to batch fix incorrect samplerate header information

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages