Thursday, January 10, 2013

Raspberry Pi recording/playback with Sound Blaster Play

Raspberry Pi doesn't come with an andio in jack. Audio in can only be supported using external USB sound card. I bought a Sound Blaster Play for this purpose. 

To enable USB audio output: 
sudo vi /etc/modprobe.d/alsa-base.conf

And comment out line: 
# options snd-usb-audio index=-2

This will enable USB audio output by default. Reboot now: 
sudo reboot

Now to record: 
arecord -D plughw:0,0 -f cd test.wav

To playback: 
aplay test.wav

Note that when recording using a non-standard format: 
arecord -D plughw:0,0 -f s16_le -r 8000 -c 1 -t raw test.raw

Don't forget to insert the -D plughw:0,0 option to force data translation: 
aplay -D plughw:0,0 -f s16_le -r 8000 -c 1 -t raw test.raw

No comments:

Post a Comment