#!/bin/bash -e

rm -f dump*pcap_f*ima.*.wav

for i in *.pcap ; do
        pcapstein $i
done

for i in *.ima ; do
	cat $i | decode-g72x -4 -a \
		| sox -r 8000 -1 -c 1 -A -t raw - -t wav $i.g721.wav
done

ffmpeg \
	-i dump*pcap_fp.ima.g721* \
	-i dump*pcap_pp.ima.g721* \
	conversation.wav -map 0:0 -map 1:0 -newaudio

mplayer -ss 2 conversation.wav
