#!/bin/bash
#
#
#
#
cd /tmp/
rm wx_*
rm haz*
wget -O haz_tmp.txt http://tgftp.nws.noaa.gov/data/raw/fl/flus41.kiln.hwo.iln.txt

#tail -n +22 haz_tmp.txt > wx_haz_tmp.txt
sed '/DAY/,$!d' haz_tmp.txt > haz_tmp1.txt
sed  '/$$/,$d' haz_tmp1.txt > wx_haz_tmp.txt 
sed -i '1s/^/This is the Hazardous Weather Outlook for Butler County. /' wx_haz_tmp.txt
sed -f /wxtext_conv.sed wx_haz_tmp.txt > wx_haz.txt

pico2wave -w wx_haz_tmp.wav "$(cat wx_haz.txt)"
#text2wave -F 48000 -otype wav wx_haz.txt -o wx_haz.wav
ffmpeg  -i wx_haz_tmp.wav -ar 48000 wx_haz.wav
sox -v -0.5 wx_haz_tmp.wav -r 48000 wx_haz.wav treble +6
/usr/local/bin/wav2dvtool wx_haz.wav KD8TUZ/HAZD KD8TUZ_B KD8TUZ_G "Hazardous WX Outlook" wx_haz.dvtool


exit 0
