Recording from the soundcard

These are the steps to configure FreeBSD to record audio from the sound card. This assumes you've got a supported sound card. This is an easy process but it took me quite a bit of trial and error to work out the details.

First, you'll need to enable your sound card. You could build a custom kernel with it as a device but the easiest way is to load a kernel module. To do this, is adding the following line to your /boot/loader.conf file:

snd_driver_load="YES"

Now reboot, and check that /dev/sndstat shows your soundcard:

$ cat /dev/sndstat
FreeBSD Audio Driver (newpcm)
Installed devices:
pcm0: <Creative EMU10K1> at io 0x1040 irq 10 kld snd_emu10k1 (4p/2r/0v channels duplex default)

See the Setting up the sound card section of the FreeBSD handbook for more info.

These packages are handy to install:

  • audio/aumix - a nice curses based mixer
  • sysutils/mixer - it saves your volume levels.

Next, you'll need to tell mixer what to use as your recording source. In this case we're using the line input:

$ mixer =rec line
Recording source: line

Now you need to set the recording level:

$ mixer rec 40
Setting the mixer rec from 0:0 to 40:40.

After you get the stream up and running you'll want to open in WinAmp (or something with a spectrum analizer) and tweak the rec level so it's not clipping.

I wanted to make sure that no other audio gets encoded into the stream so I set the levels for all the other channels to 0:

$ mixer
Mixer vol      is currently set to   0:0
Mixer pcm      is currently set to   0:0
Mixer speaker  is currently set to   0:0
Mixer line     is currently set to   0:0
Mixer mic      is currently set to   0:0
Mixer cd       is currently set to   0:0
Mixer rec      is currently set to  40:40
Mixer igain    is currently set to   0:0
Mixer ogain    is currently set to   0:0
Mixer line1    is currently set to   0:0
Mixer phin     is currently set to   0:0
Mixer phout    is currently set to   0:0
Mixer video    is currently set to   0:0
Recording source: line

for you, a photo

rock paper scissors for bikes

ads

User login