aboutsummaryrefslogtreecommitdiff
path: root/content/posts/2003-11-23-decoupled-icecast-streaming.html
diff options
context:
space:
mode:
Diffstat (limited to 'content/posts/2003-11-23-decoupled-icecast-streaming.html')
-rw-r--r--content/posts/2003-11-23-decoupled-icecast-streaming.html39
1 files changed, 39 insertions, 0 deletions
diff --git a/content/posts/2003-11-23-decoupled-icecast-streaming.html b/content/posts/2003-11-23-decoupled-icecast-streaming.html
new file mode 100644
index 0000000..79b6dab
--- /dev/null
+++ b/content/posts/2003-11-23-decoupled-icecast-streaming.html
@@ -0,0 +1,39 @@
+---
+date: "2003-11-23T06:45:19Z"
+title: Decoupled Icecast Streaming
+---
+
+<p>
+I separated the <a href='http://www.icecast.org/'>Icecast</a> streaming for <a href='/radio/'>Pablotron Radio</a> from <a href='http://www.xmms.org/><acronym title='X Multimedia System'>XMMS</acronym></a>. I'm just using <code>shout</code> to queue files for the stream now. I also wrote a brief script which calls <a href='http://www.ignavus.net/software.html'><acronym title='X On-Screen Display'>XOSD</acronym></a> to notify me when a new song comes on. Here's the script:
+</p>
+
+<pre>
+#!/usr/bin/env ruby
+
+# some XOSD settings
+ENV['DISPLAY'] = ':0'
+FONT = "-adobe-helvetica-bold-r-normal-*-20-*-*-*-p-*-iso8859-2"
+
+# fork and exit so shout doesn't block
+pid = fork
+if pid
+ Process::waitpid(pid, Process::WNOHANG)
+ exit 0
+end
+
+# make sure the cue file updates
+sleep 1
+
+# read the cue file and pipe it to xosd
+File::open('/var/log/icecast/.cue', 'r') { |cue|
+ name, size, rate, time, unknown, ofs = cue.readlines.map { |i| i.chomp }
+ IO::popen("osd_cat -p bottom -f #{FONT} -s 1 -c \\#ffcc00", 'w') { |osd|
+ osd.puts "#{time} - #{name}"
+ }
+}
+</pre>
+
+<p>
+Why go through all this trouble? So I can use <a href='http://www.xmms.org/'><acronym title='X Multimedia System'>XMMS</acronym></a> to search for and preview songs locally, without messing with the active stream. Plus it's neat to have <a href='http://www.ignavus.net/software.html'><acronym title='X On-Screen Display'>XOSD</acronym></a> notifications for stuff :).
+</p>
+