added script to convert audiofiles into needed format

master
Nidan 14 years ago
parent 19d8190115
commit 9a7aca5d17

@ -0,0 +1,13 @@
#!/bin/bash
if [ ${#} -ne "2" ] ; then
echo "Usage: ${0} <input file> <output file>"
return 1
fi
TMPFILE="convert.tmp"
ffmpeg -i ${1} -f s16be -ar 16k -ac 1 -acodec pcm_s16be ${TMPFILE}
SIZE=$(( $(stat -c "%s" ${TMPFILE}) / 2 ))
echo -ne "\0$(printf %o $(($SIZE % 256)) )\0$(printf %o $(( ($SIZE / 256) % 256)) )\0$(printf %o $(( ($SIZE / 65536) % 256)) )\0$(printf %o $(( ($SIZE / 65536/256) % 256)) )" | cat - ${TMPFILE} > ${2}
rm ${TMPFILE}
Loading…
Cancel
Save