Skip to content

Instantly share code, notes, and snippets.

@kinoshita-lab
Created November 7, 2015 01:26
Show Gist options
  • Save kinoshita-lab/5109ac4b0eadbde45ead to your computer and use it in GitHub Desktop.
Save kinoshita-lab/5109ac4b0eadbde45ead to your computer and use it in GitHub Desktop.
convert wav file to mozzi signed 8 bit
#!/usr/bin/env sh
#
# you need sox http://sox.sourceforge.net/
# and copy char2mozzi.py
wavfiles="*.wav"
for wavfile in ${wavfiles}
do
sox ${wavfile} -r 16384 -b 8 -e signed-integer ${wavfile%.wav}.raw
done
rawfiles="*.raw"
for rawfile in ${rawfiles}
do
./char2mozzi.py ${rawfile} ${rawfile%.raw}_int8.h ${rawfile%.raw} 16384
done
rm *.raw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment