• Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
HomepcDuinoLinux ApplicationsHow to capture microphone input to wav format file ...
Previous Next

How to capture microphone input to wav format file on pcDuino

Posted by: Yang , June 17, 2014

[vc_row][vc_column][vc_column_text]If you want to capture input from microphone connected to your pcDuino computer, there is a simple way to do it. But prior to recording, you probably want to adjust the input volume of your microphone for optimal quality recording. With low input volume, your microphone may not pick up your voice properly, while too high an input volume may introduce a lot of background noise in the recording.

you can adjust microphone input volume by going to “Settings” -> “Sound” -> Input.

In order to record microphone input on Linux, you can use a tool set called alsa-utils which is developed for Advanced Linux Sound Architecture (ALSA). To install alsa-utils Ubuntu:

$ sudo apt-get install alsa-utils

One of the command-line utilities contained in alsa-utils is arecord which captures microphone input to wav format.

To verify that microphone is successfully recognized on your system:

$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: CONEXANT Analog [CONEXANT Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

To record microphone input as wav format:

$ arecord output.wav
Recording WAVE 'output.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono

Without any argument, arecord will record microphone input to wav format with sample rate 8000 Hz, unsigned 8 bit depth, and single mono channel. arecord will continue to capture a stream of microphone input until it’s terminated by Ctrl+C.

If you want, you can customize output wav format as follows.

$ arecord -f cd output_stereo.wav
Recording WAVE 'output.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
$ arecord -r 16000 -f S16_LE output2.wav
Recording WAVE 'output2.wav' : Signed 16 bit Little Endian, Rate 16000 Hz, Mono

To play back a wav file, you can use another ALSA utility called aplay.

$ aplay output.wav

[/vc_column_text][vc_column_text]If you want to capture input from microphone connected to your pcDuino computer, there is a simple way to do it. But prior to recording, you probably want to adjust the input volume of your microphone for optimal quality recording. With low input volume, your microphone may not pick up your voice properly, while too high an input volume may introduce a lot of background noise in the recording.

you can adjust microphone input volume by going to “Settings” -> “Sound” -> Input.

In order to record microphone input on Linux, you can use a tool set called alsa-utils which is developed for Advanced Linux Sound Architecture (ALSA). To install alsa-utils Ubuntu:

$ sudo apt-get install alsa-utils

One of the command-line utilities contained in alsa-utils is arecord which captures microphone input to wav format.

To verify that microphone is successfully recognized on your system:

$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: sunxicodec [sunxi-CODEC], device 0: M1 PCM [sunxi PCM]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

To record microphone input as wav format:

$ arecord output.wav
Recording WAVE 'output.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono

Without any argument, arecord will record microphone input to wav format with sample rate 8000 Hz, unsigned 8 bit depth, and single mono channel. arecord will continue to capture a stream of microphone input until it’s terminated by Ctrl+C.

If you want, you can customize output wav format as follows.

$ arecord -f cd output_stereo.wav
Recording WAVE 'output.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
$ arecord -r 16000 -f S16_LE output2.wav
Recording WAVE 'output2.wav' : Signed 16 bit Little Endian, Rate 16000 Hz, Mono

To play back a wav file, you can use another ALSA utility called aplay.

$ aplay output.wav

[/vc_column_text][/vc_column][/vc_row]

Tags: Linux Applications

Share!
Tweet

Yang

About the author

Leave a Reply Cancel reply

You must be logged in to post a comment.

Category

  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors