converter fixing

master
Nidan 14 years ago
parent 33705c0f4c
commit a7509dfcd7

@ -2,12 +2,12 @@
if [ ${#} -ne "2" ] ; then
echo "Usage: ${0} <input file> <output file>"
return 1
exit 1
fi
TMPFILE="convert.tmp"
ffmpeg -i ${1} -f u16be -ar 16k -ac 1 -acodec pcm_u16be ${TMPFILE}
SIZE=$(( $(stat -c "%s" ${TMPFILE}) / 2 ))
echo -ne "\0$(printf %o $(($SIZE % 256)) )\0$(printf %o $(( ($SIZE / 256) % 256)) )\0$(printf %o $(( ($SIZE / 256**2) % 256)) )\0$(printf %o $(( ($SIZE / 256**3) % 256)) )" | cat - ${TMPFILE} > ${2}
ffmpeg -i "${1}" -f u16be -ar 16k -ac 1 -acodec pcm_u16be ${TMPFILE}
SIZE=$(( $(stat -c "%s" ${TMPFILE} ) / 2 ))
echo -ne "\0$(printf %o $(($SIZE % 256)) )\0$(printf %o $(( ($SIZE / 256) % 256)) )\0$(printf %o $(( ($SIZE / 256**2) % 256)) )\0$(printf %o $(( ($SIZE / 256**3) % 256)) )" | cat - ${TMPFILE} > "${2}"
rm ${TMPFILE}

Loading…
Cancel
Save