Skip to content

Instantly share code, notes, and snippets.

@EmmanuelKasper
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EmmanuelKasper/cf398f1b2163dd1f7541 to your computer and use it in GitHub Desktop.
Save EmmanuelKasper/cf398f1b2163dd1f7541 to your computer and use it in GitHub Desktop.
Convert files for atari STE background playing: see http://atari.8bitchip.info/STEbap.html
#/bin/sh
# if no parameter is passed, consider we want to convert mp3 files
test -n "$1" && EXT=$1 || EXT=mp3
#remvove spaces and funky characters in file names
detox *.${EXT}
#shorten file names to follow FAT 8.3 convention
rename -v "s/(\S{8}).*/\$1.${EXT}/g" *.${EXT}
for F in *.${EXT} ; do
CURRENT_NAME=$F
FUTURE_NAME=$(basename $CURRENT_NAME .${EXT})
echo processing $CURRENT_NAME
# -ar set audio sampling rate to 50066 Hz
# -c:a pcm_s8 convert to signed 8 bit PCM
# -map_metadata -1 strip metadata from file (like artist name)
# -f au to force AU file format since we use wae filename extension
avconv -i $CURRENT_NAME -ar 50066 -c:a pcm_s8 -map_metadata -1 -f au $FUTURE_NAME.wae 2>/dev/null
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment