OK, I've just found it, and it still works! Really funny. You don’t need any fancy applications, instant messengers or the like. With this command you send your audio to the remote host.
arecord -f cd -t raw | oggenc - -r | ssh <user>@<remotehost> mplayer -
Or if you like ffmpeg better
ffmpeg -f alsa -ac 1 -i hw:3 -f ogg - \
| ssh <user>@<remotehost> mplayer - -idle -demuxer ogg
Source: http://shmerl.blogspot.de/2011/06/some-fun-with-audio-forwarding.html
If you want a real telephone:
The command above was only for one direction. For the other direction you have to start another ssh session. So, to receive what the other user says to you, use
ssh <user>@<remotehost> 'arecord -f cd -t raw | oggenc - -r' | mplayer -
Or if you like ffmpeg better
ssh <user>@<remotehost> ffmpeg -f alsa -ac 1 -i hw:3 -f ogg - \
| mplayer - -idle -demuxer ogg
where hw:3
is the alsadevice you want to record (find it with arecord -l
; you can also use a device name, find this with arecord -L
; in many cases you can just use the device listed with the following command: arecord -L | grep sysdefault
).
Update
In 2018 on my Fedora Linux systems ffmpeg
does not have alsa support included (it seems to be the same on RaspberryPi systems with Raspbian). But there is a simple solution without recompiling. Just pipe the output of arecord (the alsarecorder) to ffmpeg:
ssh <user>@<remotehost> 'arecord -f cd -D plughw:2 | ffmpeg -ac 1 -i - -f ogg -' \
| mplayer - -idle -demuxer ogg
You get the input device plughw:2
by finding your device in the output of the following command:
arecord -l
In my case I see card0
and card2
(my webcam which has a microphone). So I wrote plughw:2
for card2
.
Update 2 (without mplayer)
If you don’t have or like mplayer
but ffplay
(which is part of ffmpeg
) you can use:
uncompressed wave-audio (high bandwidth, very low cpu usage on the recording side)
ssh <user>@<remotehost> "arecord -f cd -D plughw:2" | ffplay -nodisp -
compressed with flac (low bandwidth, low cpu usage on the recording side)
ssh <user>@<remotehost> "arecord -f cd -D plughw:2 | flac - -o -" | ffplay -nodisp -
compressed with ogg (very low bandwidth, high cpu usage on the recording side)
ssh <user>@<remotehost> "arecord -f cd -D plughw:2 | oggenc -" | ffplay -nodisp -