From 4b6c0e31385f5f27a151088c0a2b614495c4e589 Mon Sep 17 00:00:00 2001 From: Paul Duncan 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 +--- + +

+I separated the Icecast streaming for Pablotron Radio from XMMS. I'm just using shout to queue files for the stream now. I also wrote a brief script which calls XOSD to notify me when a new song comes on. Here's the script: +

+ +
+#!/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}"
+  }
+}
+
+ +

+Why go through all this trouble? So I can use XMMS to search for and preview songs locally, without messing with the active stream. Plus it's neat to have XOSD notifications for stuff :). +

+ -- cgit v1.2.3