What makes this approach powerful is that clients need only setup ssh key-based passwordless authentication to a trusted server of their choosing in the usual way, so that they can read from the fifo over an ssh tunnel. No proprietary closed source software or intermediary is needed for this communication, and once ssh public keys are added to .ssh/authorized_keys on the trusted host for a the given user, no man in the middle is possible.
Your system requires:
- [sox – Sound eXchange](http://sox.sourceforge.net/) (or any tool that can pipe audio streams to plain unix fifo pipes)
- [dd] (you probably already have this, its been standard on computers since before I was born)
- OSX 10.6+
sudo port install openssh
sudo port install sox
In order to allow any computer to talk to any other its best to setup a proxy somewhere out on the net that both the client and server have ssh access to.
>First ssh to the intermediary server and make a fifo pipe that the sound will travel through:
ssh firstname.lastname@example.org "mkfifo one_directional_voice_channel"
>Then on the sound receiving client side where you want to play the sound back:
ssh email@example.com "dd if=one_directional_voice_channel" | sox -p -d --buffer 32
>Next on the sound transmission end with the microphone you want to send the audio from simply:
sox -d -p --buffer 32 | ssh firstname.lastname@example.org "dd of=one_directional_voice_channel"
> Presto. done. On my computer, the default sound input device is the microphone so my voice immediately starts being relayed across the net to the client over the ssh tunnel.
***Well you do need to setup another channel in the other direction for two way voice communication but that's it.
Starting the client listener first ensures the buffers are empty so there is no lag between sending and receiving sound. In my tests a voice stream from my location to a server 1500km away and back has a delay of less than 1 sec.
If it's working you should see an output similar to this:
Encoding: Signed PCM
Channels: 2 @ 32-bit
In:0.00% 00:10:02.08 [00:00:00.00] Out:26.6M [ | ] Clip:34
- your days are numbered M$ Skype *