Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #Requires zip, unzip, vorbis-tools
- unzip -o "$1" 'SOUNDS/*' -d /tmp/BrutalDoomSoundFix/
- pushd /tmp/BrutalDoomSoundFix/
- echo 'Finding stereo files...'
- find ./SOUNDS/ -print0 | xargs -0 -n1 file | grep "stereo" | grep -v "[oO]gg" | sed -e 's/:\s.*$//' | xargs -d '\n' -n1 -P0 sh -c 'oggenc --downmix -o "./newsounds/$0" "$0"'
- find ./SOUNDS/ -type d -exec mkdir -p './oggs/{}' \;
- echo 'Finding stereo files...'
- find ./SOUNDS/ -print0 | xargs -0 -n1 file | grep "stereo" | grep "[oO]gg" | sed -e 's/:\s.*$//' | xargs -d '\n' -P0 -n1 sh -c 'oggdec -o "./oggs/$0" "$0"'
- ( cd ./oggs/;find ./SOUNDS/ -type f -print0 | xargs -0 -P0 -n1 sh -c 'oggenc --downmix -o "../newsounds/$0" "$0"' )
- ( cd ./newsounds/;cp -rf ./SOUNDS/ ../ )
- popd
- mv /tmp/BrutalDoomSoundFix/SOUNDS ./
- rm -rf /tmp/BrutalDoomSoundFix/
- zip -dr "$1" 'SOUNDS/*'
- zip -9 -rm "$1" 'SOUNDS'
- echo 'Done!'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement