The Alabama Legislature provides mms:// streams of the House and Senate while in session but does not keep an archive of past sessions, so it falls to us citizens to do it.
So first lets discuss the needed, a connection to the internet faster than dialup speed, a box running some OS that supports tools to save/convert/edit the streams, hard drive space (about 100 megs per day) and time.
Since most folks are using windows 2000 or higher (XP, Vista) will focus on that OS. The command line (but not the batch file) shown will work under linux and BSDish things like OS X, too.
Now to tools, from the unix world, there are well working ports of vlc and mplayer which will save the streams. Both are open source, free as in beer, suitable for daily use.
However, the streams are sent out in a proprietary format instead of the universally known and understood mp3. While mplayer can capture the stream, it cannot convert an audio only stream (under windows) to another format. VLC however, can capture the stream and while capturing transcode it into mp3. So lets use install vlc and make sure its on the path.
Now for a bit of work at the console, fire off a command prompt and paste this (which should be all on one line may need assembly in an editor):
start vlc mms://alisonhseav.legislature.state.al.us/HSEAUDIO :sout=#transcode{acodec=mp3,ab=32,channels=1}:duplicate{dst=std{access=file,mux=raw,dst=House-date.mp3}}
If the house is in session you will find a growing file named house-date.mp3
Same for the Senate and yes you can run two instances of VLC at the same time.
start vlc mms://alisonsenav.legislature.state.al.us/SENAUDIO :sout=#transcode{acodec=mp3,ab=32,channels=1}:duplicate{dst=std{access=file,mux=raw,dst=House-date.mp3}}
You also do this thru vlc’s gui but this won’t work for automation.
A few things to consider, learn to use ALISON to keep track of when the House and Senate will meet. Use the windows task scheduler in the control panel to automate saving the streams. Have lots of empty hard drive space. Thursday’s session of both houses took up about 70 Megs of space. I edit the copies I keep to remove the silent periods when they go into recess which trims a few megs off. Also thru ALISON download the House and Senate Activity reports for the particular. When placed with the audio files, it will help folks decide which driods they are looking for. Also look at Adjourn/Convene for the next meeting time and meeting times of the current session (to ensure you got it all).
Simple minded batch files to handle the process follows:
==== cut on dotted line and paste into notepad save as house.cmd ==========
REM The lines of code to the C: command were copied from a posting by William Allen of www.allenware.com on www.eggheadcafe.com
REM Exact url of the post http://www.eggheadcafe.com/forumarchives/Windows2000cmdpromptadmin/Aug2005/post23133879.asp
ECHO/d=DateAdd(“d”,-3*(Weekday(now)=6),now)>_TEMP.VBS
ECHO/d=Year(d) ^& Right(“0″ ^& Month(d),2) ^& Right(“0″ ^& Day(d),2)>>_TEMP.VBS
ECHO/WScript.Echo “SET UseDate=” ^& d>>_TEMP.VBS
cscript//nologo _TEMP.VBS>_TEMP.BAT
CALL _TEMP.BAT
DEL _TEMP.BAT _TEMP.VBS
REM end allen code
REM begin bungler code
REM make sure files drop where we want them
c:
cd %HOMEDRIVE%%HOMEPATH%
REM start saving house stream
start vlc -vvv mms://alisonhseav.legislature.state.al.us/HSEAUDIO :sout=#transcode{acodec=mp3,ab=32,channels=2}:duplicate{dst=std{access=file,mux=raw,dst=HOUSE-%UseDate%.mp3}}
======================== cut here end of house.cmd ======================
=======================cut here start of senate.cmd =======================
REM start saving senate
REM
REM The lines of code to the C: command were copied from a posting by William Allen of www.allenware.com on www.eggheadcafe.com
REM Exact url of the post http://www.eggheadcafe.com/forumarchives/Windows2000cmdpromptadmin/Aug2005/post23133879.asp
ECHO/d=DateAdd(“d”,-3*(Weekday(now)=6),now)>_TEMP.VBS
ECHO/d=Year(d) ^& Right(“0″ ^& Month(d),2) ^& Right(“0″ ^& Day(d),2)>>_TEMP.VBS
ECHO/WScript.Echo “SET UseDate=” ^& d>>_TEMP.VBS
cscript//nologo _TEMP.VBS>_TEMP.BAT
CALL _TEMP.BAT
DEL _TEMP.BAT _TEMP.VBS
REM end allen code
REM begin bungler code
REM Make sure files go where we want them
c:
cd %HOMEDRIVE%%HOMEPATH%
start vlc -vvv mms://alisonsenav.legislature.state.al.us/SENAUDIO :sout=#transcode{acodec=mp3,ab=32,channels=2}:duplicate{dst=std{access=file,mux=raw,dst=Senate-%UseDate%.mp3}}
================================= cut here ==============================
Could cut and paste this into two files, needed since house and senate don’t start at the same time.
A caveat as the stream ends vlc starts using sucking up all the available CPU cycles until the stream stops. Could add vlc://quit to the command line if this proves bothersome.
Use Audacity to cut out the empty spaces when in recess but consider leaving a bit of silence in between so folks dont hear “lets do lunch” then the noise of people entering and gabbling about fire trucks.
Have fun
[...] this earlier post, you can extract the framework of a batch file to do all this for [...]
Pingback by mplayer and the alabama legislature’s audio streams « Not Much — March 9, 2009 @ 2:26 pm