10Jul

Raspberry Pi Audio Input and Output with USB Sound Card

Raspbian sound input and output.

1) Force the USB sound card to be the default sound device
Use nano to open file /etc/modprobe.d/alsa-base.conf

Change:

options snd-usb-audio index=-2

To:

options snd-usb-audio index=0

Then add:

options snd_bcm2835 index=1

2) To record sound

Use command:

arecord -f cd -d 10 -c 1 record.wav

This command records sound input from the microphone for 10 seconds and writes the audio to record.wav file.

3) To playback recorded audio

Use command:

aplay -f cd -D plughw:0,0 record.wav

Share this Story

About chaoming.li

Technology entrepreneur, web analytics specialist, Internet enthusiasts. I also like movies, computer games, history and other interesting stuff. I was born in Guangzhou China and I live in Sydney Australia now.

3 comments

  1. Hi,

    I followed every process here and I tried to record. It does only record a metallic noise not my voice. I have tried to increase and decrease the capture level from alsamixer and also I tested the output by playing a different sound. When i try arecord it does stay there pretending like it is working but nothing works. It just records noise.

    I am really looking forward to make it work. Any idea what is going wrong? I am newbie in rpi2 but not to linux and programming. I thank you for this nice guide. really looking forward to have your thoughts on this comment.

    Thanks in advance,
    Roy

  2. Dear Li,

    Do you mind share the sourcecode for the raspberry pi voice recognition?

    Thanks you and have a nice day.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

© Copyright 2014, All Rights Reserved