-------------- next part --------------
pcm.!default {
type plug
slave.pcm "asym"
}

pcm.asym {
type asym
playback.pcm "save"
capture.pcm "dmixin"
}

pcm.dsp0 {
type plug
slave.pcm "asym"
}

pcm.dsp {
type plug
slave.pcm "asym"
}

pcm.save {
type file
slave.pcm "dmixout"
file "/var/tmp/record.raw"
}

pcm.dmixout {
type dmix
ipc_key 12345
ipc_key_add_uid yes
slave {
pcm hw
channels 2
period_size 1024
buffer_size 32768
rate 44100
}
bindings {
0 0
1 1
}
}

ctl.mixer0 {
type hw
card 0
}

pcm.dmixin {
type dsnoop
ipc_key 98765
ipc_key_add_uid yes
slave {
pcm hw
channels 2
period_size 1024
buffer_size 32768
rate 44100
}
bindings {
0 0
1 1
}
}

-------------- next part --------------
#!/bin/sh
RECORDFILE=/var/tmp/record.raw
OUTFILE=/var/tmp/sound.raw
NULLFILE=/var/tmp/null.raw

case "$1" in
-on)
echo "Erasing old recording in $OUTFILE..."
echo -n "If OK press enter:"
read ans
> $OUTFILE
ln -sf $OUTFILE $RECORDFILE
;;
-off)
if [ "$(realpath $NULLFILE)" != "/dev/null" ]
then
rm -f $NULLFILE
ln -s /dev/null $NULLFILE
fi
ln -sf $NULLFILE $RECORDFILE
echo "Recording in the raw format 16bit 2-channel at 44.1KHz"
echo "is in $OUTFILE and can be played with the command:"
echo "aplay -f cd $OUTFILE"
;;
-show|-sh)
ls -l $RECORDFILE
;;
*)
echo "$0: -on switches on recording an -off switches it off "
;;
esac

#EOF

