Secure audio stream over network - K.I.S.S. version

2006/10/28 23:25
Yes, there are a lot of sophisticated alternatives to achieve this, but keeping it simple and stupid might be practical. Here is a quick hack i did in order to stream music from MacBook Pro over wlan to Mac Mini (with G4) that happens to be connected to amplifier (and TV).
  • Installed esound package to both computers using DarwinPorts
  • Installed SoundFlower audio routing system extension to MacBook Pro

To try it out, select soundflower (2 channel) as input and output sound device from system preferences. And start streaming the audio with following command (on MacBook Pro):

esdrec | ssh mac.mini.address esdcat
Unfortunately starting iTunes on MacBook Pro outputs horrible white noice from speakers connected to amplifier because of byte order mismatch. Another K.I.S.S. solution was to write a simple (stupid) byte-order-swap -filter to the pipe:
#include 

int main() {
	int buf[4],i;
	while (1) {
		for (i=0; i<4; i++) {
			buf[i] = getchar();
			if (buf[i] == EOF) return 0;
		}
		for (i=3; i>=0; i--) putchar(buf[i]);
	}
}
and compile it with: gcc -o swapbyteorder swapbyteorder.c Finally this works beatifully:
esdrec | swapbyteorder | ssh mac.mini.address esdcat

Login to your gmail-account to post comments to this blog.