Server support is in place for recording sound output by the gdam server to a given device. The sound can be written directly to disk, or sent to another process (i.e. an mp3 encoding process on some machine).
The long way to do this is to use the gdamcli program to start and stop the recording. You do this:
% ./gdamcli [--device /dev/dsp?] # Print out the mixer's information. The `parent' # is always the recording filter. gdam-cli> ls -a $mixer source 1. arg 0: mixed => [] arg 1: parent => 2 arg 2: terminates => 0 arg 3: paused => 0 arg 4: mode => eternal arg 5: parent_device => 0 arg 6: position => 182272L arg 7: subsources => [] # The number after `call' should be the parent number. gdam-cli> call 2 add_output connect your_host:your_port_number arg 0: output_id => 1 # So now it'll be connecting/recording on your host. |
And to stop it:
gdam-cli> call 2 remove_output output_id 1 # will stop it (use the output_id it gives you) # You can record to multiple computers this way. # Finally, instead of `connect' you can say `file' # which will make the server write the raw sound data # to a local file. |
The cli/record-mp3 script attempts to automate this, as its first argument it takes the host and port to tells the gdam server to connect to host:port as specified as the argument to the script. The cli/record-stop scripts removes the output which record-mp3 adds.
The gdam-launcher pops up single turntables with an entry at the bottom for a recording location. Format is 'host:port'. Pressing the Record button will cause the entire mix being sent to the first sound device (the value of the first --device flag, or the GDAM_DEVICE environment variable, or /dev/dsp by default) to be mirrored to the given host. While it is recording, the button will remain depressed. Press it again to stop the recording.
We have used gogo to encode mp3 data, and with some success, but it seemed a bit unstable. lame isn't quite as fast, but it hasn't crashed yet. Try the following line in your inetd.conf:
6060 stream tcp nowait nobody.audio /usr/sbin/tcpd /usr/local/sbin/run-lame |
#! /bin/sh DATE=`date +%d-%b-%Y-%H:%M:%S` /usr/local/bin/lame -r -x -m s - /mnt/18/lame/l-$DATE.mp3 > /tmp/lame.log.$DATE 2>&1 |
#! /bin/sh DATE=`date +%d-%b-%Y-%H:%M:%S` /usr/bin/gogo stdin /mnt/18/gogo/$DATE.mp3 -offset 0 > /tmp/gogo.log.$DATE 2>&1 |
If you want to talk to a Shoutcast server, here is an untested alternate script that can be run from inet.d by Scott Manley (aka Szyzyg) <>.
#! /bin/sh DATE=`date +%d-%b-%Y-%H:%M:%S` mkfifo /tmp/mp3pipe echo "password" > /tmp/shoutheaders echo "icy-name: Test" >> /tmp/shoutheaders echo "icy-genre: Mixed" >> /tmp/shoutheaders echo "" >> /tmp/shoutheaders /usr/bin/lame - - > /tmp/mp3pipe & cat /tmp/shoutheaders /tmp/mp3pipe | nc localhost 8000 |
Further icecast utilities to come...