I want to change the pitch using sox, of each mp3 in every music folder I have. I wrote this in bash:
function pitch_mp3 { for mp3 in /home/mp3s/*/*.mp3 do cd "$(dirname "$mp3")" output=$(basename "$mp3" .mp3)PITCHED.mp3 sox -S "$mp3" -C 192 "$output" pitch 50 done }
It adds a step to the example 01song.mp3, and the output file is 01songPITCHED.mp3. But it so happens that sox does the work for the first time, but then it goes by bicycle again to the folders and adds a step to the already laid out mp3 files, so the file name turned out to be 01songPITCHEDPITCHED.mp3. I stopped him when I noticed, so I donโt know if he will add a step a third time, etc.
Why and how to fix it?
source share