Advertisement
Guest User

brutaldoomsoundfix.sh

a guest
Jul 30th, 2016
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.86 KB | None | 0 0
  1. #!/bin/bash
  2. #Requires zip, unzip, vorbis-tools
  3. unzip -o "$1" 'SOUNDS/*' -d /tmp/BrutalDoomSoundFix/
  4. pushd /tmp/BrutalDoomSoundFix/
  5. echo 'Finding stereo files...'
  6. 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"'
  7. find ./SOUNDS/ -type d -exec mkdir -p './oggs/{}' \;
  8. echo 'Finding stereo files...'
  9. 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"'
  10. ( cd ./oggs/;find ./SOUNDS/ -type f -print0 | xargs -0 -P0 -n1 sh -c 'oggenc --downmix -o "../newsounds/$0" "$0"' )
  11. ( cd ./newsounds/;cp -rf ./SOUNDS/ ../ )
  12. popd
  13. mv /tmp/BrutalDoomSoundFix/SOUNDS ./
  14. rm -rf /tmp/BrutalDoomSoundFix/
  15. zip -dr "$1" 'SOUNDS/*'
  16. zip -9 -rm "$1" 'SOUNDS'
  17. echo 'Done!'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement