From 4b6c0e31385f5f27a151088c0a2b614495c4e589 Mon Sep 17 00:00:00 2001
From: Paul Duncan <pabs@pablotron.org>
Date: Thu, 14 Oct 2021 12:47:50 -0400
Subject: initial commit, including theme

---
 .../2003-11-23-decoupled-icecast-streaming.html    | 39 ++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 content/posts/2003-11-23-decoupled-icecast-streaming.html

(limited to 'content/posts/2003-11-23-decoupled-icecast-streaming.html')

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>
+
-- 
cgit v1.2.3