Difference between revisions of "User:Mjb/Winamp & SHOUTcast"
m (Mjb moved page User:Mjb/SHOUTcast to User:Mjb/Winamp & SHOUTcast) |
|
(No difference)
|
Revision as of 02:50, 11 December 2013
Winamp playlist regeneration on Windows
Every day, I want to:
- Regenerate a UTF-8-encoded playlist, picking up any changes made on my file system
- Load the new playlist in Winamp
I used to have a clever Python script for this purpose, but installing Python on Windows is an awfully steep prequisite. As it turns out, a single Windows command-shell command does the trick. This all goes on one line:
cmd.exe /C "chcp 65001 && dir Z:\music /b /s | findstr /e /l ".mp3 .flac .m4a .wav .wma .ogg .mp2" | findstr /e /l /v ".lnk" > playlist.m3u8" && start /b playlist.m3u8
Here's an explanation:
&&
= if the previous command completed without error, do what comes next.|
= pipe the text output of the previous command as input to the next.>
… = put the output of the previous command into the designated file.cmd.exe /C "
…"
= open a command shell window and run the quoted command(s).chcp 65001
= set the active code page to UTF-8dir
…/b /s
= recursively list the files in the given folder(s), only listing their full paths.findstr /e /l "
…"
= output only lines ending with any of these literal strings.findstr /e /l /v "
…"
= output lines not ending with any of these literal strings.start /b
… = open the designated file as a background process (no window).
To get it to run every day, you need to add it to the Task Scheduler. You can do this through the Management Console or with a command-line command (schtasks), the syntax of which is too painful to deal with.
SHOUTcast stream transcoding
In 2008, I was looking into offering a low-bitrate MP3 version of an audio stream by connecting to it as a client, transcoding it, and feeding it to another server.
I didn't get very far in my research, but did find several options for grabbing a stream to a file on Unix:
mpg123 -b 4096 -s streamURL > out.mp3 gnetcat -l -p 8081 streamIP streamPort | lame --mp3input -b 64 - out.mp3 mpg123 -b 4096 -s streamURL | lame --mp3input -b 64 - out.mp3
And then there was also fIcy: an icecast/shoutcast stream grabber suite.
I don't remember if I tried any of these. The idea, though, was that if I could send the data to a file, the file could actually be a named pipe into icecast or something. However it didn't occur to me that I'd probably lose the protocol data (stream info and song titles). So it was starting to look like the only real option was going to be streamTranscoder, last updated in 2004.