After some thinking (which hurts) reworked my batch file to save the legislature’s audio streams. I made it more generic and should be self explanatory.
For testing purposes I use the ten minute long stream from NHK radio of top news stories.
Batch follows
REM
REM routine to fill %UseDate% from MS posting
SET UseDate=%date:~4,2%_%date:~-7,2%_%date:~-4,4%
REM
REM set some variables
REM Using NHK's ten minute long news update for testing purposes
REM SET URL=mms://wm.nhk.or.jp/rj/on_demand/wma/english.wma
REM Alabama House of Representatives
REM SET URL=mms://alisonhseav.legislature.state.al.us/HSEAUDIO
REM Alabama Senate
REM SET URL=mms://alisonsenav.legislature.state.al.us/SENAUDIO
REM set name for what we are recording
REM SET STATION=NHK_News
REM SET STATION=House
REM SET STATION=Senate
REM make sure files drop where we want them
REM set full path to where you want the files
SET dump=%HOMEDRIVE%%HOMEPATH%\Desktop\dumpfiles
REM set storage location for dump files
REM make sure to create this folder first
SET storage=%dump%\storage
REM variables to hold filenames for when recording started and ended
SET startrec=%STATION%_Recording_Started
SET stoprec=%STATION%_Recording_Stopped
REM
REM change to drive and folder that will hold files
REM
REM change below to the drive letter that will hold the files
%HOMEDRIVE%
cd %dump%
REM create text file to show when recording started
echo %startrec%_%time% > %startrec%._%UseDate%.txt
REM
REM start saving stream
mplayer %URL% -dumpfile %STATION%_%UseDate%.dump -dumpstream
REM create file to show when recording stopped
echo %stoprec%_%time% > %stoprec%_%UseDate%.txt
REM
REM dumpfile to wav for sox
mplayer -quiet -vo null -vc null -ao pcm:waveheader:file=%STATION%_%UseDate%.wav %STATION%_%UseDate%.dump
REM use sox to trim silence on ends of recording, reduce periods of silence within file to 1 minute and
REM convert to mono mp3
REM could use ffmpeg to make wma but lets use mp3 filesize is smaller
sox -V -S %STATION%_%UseDate%.wav -c 1 %STATION%_%UseDate%.mp3 silence -l 1 00:00:00.5 -45d -1 00:01:00 -45d
REM Create plain text file holding date and time recording started and ended
REM Could also append remarks to file e.g Alabama State Government claims copyright or whatever
type %startrec%._%UseDate%.txt > %STATION%_%USEDATE%.txt
type %stoprec%_%UseDate%.txt >> %STATION%_%UseDate%.txt
REM clean up
del %STATION%_%UseDate%.wav
REM move dump file to storage
move %STATION%_%UseDate%.dump %storage%