summaryrefslogtreecommitdiffstats
path: root/contrib/gen_testdata.sh
blob: a8bb8c9a4ed52f52ec921bda2ae65d9a778ad7c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh

# script to generate a .s16 file (s16le with 8kHz) from an arbitrary MP3
# usage: gen_testdata.sh foo.mp3 foo.s16

WAV=`mktemp`
MP3=$1
S16=$1

mpg123 -w "$WAV" "$MP3"
sox "$WAV" -b 16 -c 1 -r 8000 "$S16"
rm "$WAV"