Recording sound on server with no sound card

Ever tried to record sound on server machine without sound card? Easy! I’ve tested it on Ubuntu 9.10 Server – let’s say this is virtual sound card:

Install dummy sound card module and alsa:

modprobe snd_dummy
apt-get install alsa

Create file /etc/asound.conf:

pcm.!default {
	type plug
	slave {
		pcm file
	}
}

pcm.card0 {
	type hw
	card 0
}

pcm.file {
	type file
	slave {
		pcm card0
	}
	file "/tmp/file.wav"
	format "wav"
}

Reload alsa: /etc/init.d/alsa-utils restart

Now everything you play on your linux box will be stored in /tmp/file.wav. You can also play with pipes to convert it on the fly etc.

Some useful links:

Comments

Leave a Reply