Command line tool to find clipping audio files?
Moderators: MattKingUSA, khz
Command line tool to find clipping audio files?
I am currently sampling audio files with synthclone. This is a great way to automate the task but I want to know for sure that no samples are clipping. Is there a command line tool that I can run on the sample folder to analyze all audio files and tell me which ones are clipping? Or something else similar? Would be a quick and easy way to identify any individual samples that I might potentially have to fix.
Re: Command line tool to find clipping audio files?
Allright, I needed to figure this out too. This seems to work:
That lists audio files with clipping. It's not exact so I added "gain 0.1" (in decibels) to catch anything *almost* clipping just to be on the safe side. You might want to leave that out or tweak the gain.
Audacity has a Find Clipping tool under the Analyze menu.
Code: Select all
for i in *; do echo $i `sox $i -n --norm -R gain 0.1 2>&1`; done |grep clipped
Audacity has a Find Clipping tool under the Analyze menu.
Re: Command line tool to find clipping audio files?
Thank you very much. That works exactly how I wantedtnovelli wrote:Allright, I needed to figure this out too. This seems to work:
That lists audio files with clipping. It's not exact so I added "gain 0.1" (in decibels) to catch anything *almost* clipping just to be on the safe side. You might want to leave that out or tweak the gain.Code: Select all
for i in *; do echo $i `sox $i -n --norm -R gain 0.1 2>&1`; done |grep clipped
Audacity has a Find Clipping tool under the Analyze menu.
Re: Command line tool to find clipping audio files?
Thank you for the command. It would be nice to do it recursively, to check all files in one step.
- bluebell
- Established Member
- Posts: 1924
- Joined: Sat Sep 15, 2012 11:44 am
- Location: Saarland, Germany
- Has thanked: 112 times
- Been thanked: 119 times
Re: Command line tool to find clipping audio files?
I can't test it at the moment but a shell file like this should work:vma wrote:Thank you for the command. It would be nice to do it recursively, to check all files in one step.
Code: Select all
#!/bin/bash
find . | while read LINE
do
sox "$LINE" -n --norm -R gain 0.1 2>&1 | grep clipped && echo "$LINE"
done
- chmod 755 clippedfiles.sh
- go to the desired directory with the audio files
- run the script with /path/to/your/script/clippedfiles.sh
Linux – MOTU UltraLite AVB – Qtractor – http://suedwestlicht.saar.de/
Re: Command line tool to find clipping audio files?
Thank you very much bluebell. I do not have my music files here, but I used my "service" computer to run your bash script and it works.