Record streaming radio with streamripper

Yes, many radio shows are available as podcasts. However, some are not. If a radio show is also broadcasted via a live stream online, then we could record it with streamripper. I did so as follow:

<pre class="src src-sh">sudo apt-get install streamripper <span style="color: #ff4500;">## </span><span style="color: #ff4500;">install</span>

## record for 60 seconds streamripper http://kpcclive1.publicradio.org:80/ -s -l 60 -a “Prarie – %d”

To have the show be recorded automatically, first create record.sh:

#! /bin/bash

## set in crontab: ## 59 17 * * 6 /path/to/record.sh cd /path/to/save/; streamripper http://kpcclive1.publicradio.org:80/ -s -l 3720 -a "Prarie - %d" &> /dev/null

Then add the following cron entry via crontab -e:

59 17 * * 6 /path/to/record.sh

Access or stream remote files on Android using EStrong File Explorer

I currently use AndFTP to download files remotely using the ftp or sftp protocol. For local file access, I use something like ASTRO File Manager or Linda File Manager. I recently discovered EStrong File Explorer, a file manager that lets me access both local and remote files. You can access or stream remote files directly without downloading it first. That is, you can select an mp3 file and play it with your favorite music app directly. It is like the remote server is mounted on the device like in Linux which makes file access feel seamless. Too bad streaming movie files like XviD is a little laggy with MX Video Player or Rockplayer Lite even when the server is on the local network.

Stream music to client via DAAP

Now that I have a NAS at home, I plan to place stuff that takes up a lot of space that doesn’t get used so often on there. However, with that comes the issue of file access. Since my NAS is linux based – ubuntu server edition to be exact – I can access files via ssh, sftp, ftp, sshfs (map the drive), samba, etc. I should probably write a blog post about sshfs and samba soon.

However, what if I want to listen to music in my music player, say itunes on Mac/Windows or rhythmbox (or amarok, bashee, etc) on Linux? The good thing about itunes and these bloated music players are that they have a database of all your music files, so finding the song is fairly quick (type in artist name or song title). Double clicking the files on the mounted drive is no problem, but having this “search and play” capabilities is quite useful. Luckily, there are many solutions to this, one of which is the DAAP method. Read here for an overview.

Game plan is as follow:

  1. Set up music server on NAS.
  2. Be able to access the songs in itunes or the likes on remote servers in the same network.
  3. Be able to access the songs in itunes or the likes on remote servers when on a different network, say at school (or at work).

The first point is fairly easy on Ubuntu: install Firefly Music Server (formerly known as mt-daapd). Following these instructions, I did

 <pre class="src src-sh">sudo apt-get install mt-daapd

sudo apt-get install libid3tag0 sudo apt-get install avahi-utils ## needed for remote access sudo adduser media su media mkdir /home/media/music exit

Place music in /home/media/music or create a symlink to the music folder.

 <pre class="src src-sh">sudo /etc/init.d/mt-daapd start

sudo update-rc.d mt-daapd defaults

Now, from that computer, go to http://ip.address:3689 (username and password is mt-daapd). On this site, we can set up the configuration. Set username/password, password to listen, and music folder. Then scan the files. (Might have to do sudo /etc/init.d/mt-daapd start).

From here, computers on the network should be able to see the music server in itunes or rhythmbox (point 2) and play music (after entering music password). NOTE: I initially thought that you had to “Open Audio Stream…” or the likes on the music players, but that is for internet radio or something; DAAP servers will broadcast the music server to the network.

To do point 3, the first thing to do is set up port forwarding on the router (3689 to 3689 on the music server). The remaining part is a bit tricky. First, you have to do ssh tunneling so that the remote music server appears to be on the same network as your computer/laptop. Then we have to forward the “broadcast” from the DAAP server (the server that itunes sees, for example).

For a Linux client, instructions can be found here and here:

 <pre class="src src-sh">ssh my@daap.server.no-ip.org -N -f -L local.ip:6689:localhost:3689

avahi-publish-address -v -H “name of your host”.local -s “My daap share” _daap._tcp. 6689 & ## find name of host from echo $HOSTNAME

Now, itunes or other clients on the remote server should see “My daap share” on the Shared list. NOTE: currently, Linux players such as rhythmbox and banshee can’t play music this way. I’m sure a fix should be coming soon. If a mac is also on the same network as this current linux client, it will see the shared daap server and connect and play music.

For a Mac client, instructions can be found here:

 <pre class="src src-sh">dns-sd -P <span style="color: #ffa07a;">"Home iTunes"</span> _daap._tcp local 3689 localhost 127.0.0.1 <span style="color: #ffa07a;">"Arbitrary text record"</span> &amp;

ssh -C -N -f -L 3689:localhost:3689 myusername@blahblahblah.dyndns.org

Itunes should be able to see the remote daap server.

For a Windows machine, I’m sure one would have to rely on RendezvousProxy, following these instructions. I will test this out soon (setting this up for my girlfriend).