Sunday, March 30, 2008

M3U Musings

One of my job's pleasures is the balance of high and low concentration work. (One of its disappointments is there's no work that ever gets me in to "flow" but that's another subject.) Anyway, when I have to concentrate, I try to minimize the distractions. When I don't have to, I actually want distractions or I get so borred I start snacking. And one of my favorite, zero calorie distractions is ACB Radio.
For some reason, known only to the guys who configure our routers, I can't listen to its live streams at work, but the On Demand stuff plays just fine. The problem with On Demand, is that sometimes I can be happily listening to a stream, when suddenly my attention is requested. Perhaps my phone rang, my boss walked in, a student stopped byor the computer is displaying an error message I have to contend with.
So suddenly I have to concentrate and turn off the internet radio. In Winamp, I press the spacebar to pause the stream.
but later when I return, Winamp plays the remainder of its buffer and then proceeds forwards to the next file in the M3u. (If anyone knows how to stop this annoying behavior of Winamp, I'd love you to share the secret!)
Techie note: an M3u file is what gets downloaded when you listen to some streams and certainly those on ACB Radio's On demand section. It's just a little text file listing the URLS, one to each line of an MP3 file to stream. You could easily download the file and listen to it offline. So for example, if I wanted to hear the third ACB Interactive Birthday bash, the file I'd be downloading when I selected the On demand Birthday bash link is acbribirthday2003.m3u. Internet Explorer would open this automatically in Winamp, because that's how my system is set up. Winamp would know how to handle this M3u. It would open it and fine the line
This would tell Winamp to get the file from the ACB Radio server and start playing it while it was still being copied from the server to my PC.
I could also manually rename the .m3u file to a .txt file, open it in notepad, learn the name of each MP3 file it referenced, FTP to the ACB radio server, log in anonymously and download the acbribirthday2003.mp3file myself.
And I used to do this too, if I thought I might get interrupted and want to resume listening later in the middle of a stream.
Then I realized that wget, a little tool that gets handier every day would do the trick for me. From a command line, I could just type wget -i acbribirthday2003.m3u and wget, whose speciality is noninteractive downloading of http and ftp content, would automagically get all the MP3 files listed in the m3u.
So I created a m3u folder and now I download the M3u files to it. Then I execute wget on that folder once in a while, and my streams are ready for me to listen without being connected to the internet.
Because my version of wget at least doesn't appear to process wildcards, I had to write this little batch file wrapper to force wget to run through all the m3u files in the current directory:
-----Cut Here-----
@echo off
Rem M3uGet, batch file to download all MP3s referenced in a group of M3U files
Rem Requires wget from gnuwin32
Rem and that the current directory will contain the results.
if %1X == X goto Help
if not exist %1 goto Error
Echo About to process the contents of the files listed below:
FOR %%A in (%1.m3u) do echo %%A
FOR %%A in (%1.m3u) do wget -i %%A
Echo Finished processing %1.m3u
goto Done
Echo M3UGet: download MP3 files referenced in an M3U file.
Echo Specify a filename or by wildcards, a group of files.
Echo Don't include an extension; the .M3U is appended automatically.
echo For example, type "M3UGet *" to process all M3u files in the current directory
echo or "M3UGet MM*" to process all M3U files that start with the letters "MM".
echo Or even "M3uGet c:\downloads\streamns\O*" to process all M3u files beginning
echo with the letter O located in your c:\downloads\streams path.
echo ---
goto Done
Echo Sorry, cannot find %1.M3U
Echo M3uGet: finished running.
-----Cut here ------
So yeah, this works, and I'm a happy camper.

More on happy camping

I recently read "Accidents of Nature", a young adult novel by famed disability rights activist Harriet McBryde Johnson. What to say about this novel! It's simply wonderful. I've never read anything that captures the disability experience better.
It's basically a simnple story about Jean, a teen with C.P. who spends two weeks at the mythical, but all too real summer camp courage. There she pals around with a group of other disabled teens, whose
ringleader, Sarah is the author's alter-ego. Sarah by contrast is a troublemaker, who speaks out
against the conventional wisdom of treating disabled people as brave cripples who we must only pretend can contribute to society. Like many comming-of-age characters, Jean must confront herself, realizing that up until now she's been the crip that Sarah decries. Jean has always gone to school with non-disabled kids, pretending that she isn't any different. Confronting her own differences at the end of the novel, she knows she has to forge a unique path towards her adulthood.
If you like fiction about disabled people, this is a must read. There is no politics, no lecturing, no
strident voices or grating tone. The characters are so breathtakingly real you will feel like you went to camp with them too when the novel is over.
"Accidents of Nature" is available from NLS and can be downloaded from Web-Braille.

No comments: