I'm looking for a command line program to capture audio from a microphone, save and stream it over a WAN.
arecord test.wav seems to work for recording input, but I cannot figure out how to get it to save as an mp3 for file size reduction.
could I stream audio over SSH? would VLC work?
If you'd rather not get too heavy about this, you can just stream over the raw sound, like you suggest in your question. You can also convert it to MP3 (or another codec - speex might be worth it, if it can be streamed) to save a bit of bandwidth.
Here's what I'm running successfully here:
That just uses
arecord
to record from the default source (-q
is there to keep it quiet). That can, of course, be tuned. That recording data gets piped throughlame
which is an MP3 encoder. That output is received back over SSH to your client machine, where it gets piped intompg123
, a command line MP3 player.Note I have SSH key authentication set up, so there's no password prompt. I'd suggest you do something similar.
You might have issues with
arecord
. I tried it on our media centre first of all but that wasn't having any of it. I stopped trying to guess which device it wanted me to use and tried the laptop which "just worked".I'm not entirely sure what your end game is (intercom, just broadcast, etc) but there are a number of options based on existing tech:
Group chat options like TeamSpeak are good for multiple applications where you want a talk-on-demand feature but require a client-server structure. It's all free and it's probably the best set up for a very-low-bandwidth situation.
Radio streams like IceCast (see here for help on setting it up) are good when you're got a little more bandwidth to play with. It still uses an intermediary server to stream the audio out to clients but this can be installed on your local computer.