How to test microphone with Audio Linux Sound Architecture

The objective of this article is to provide the reader with an information on how to test microphone on Linux system.

In this tutorial you will learn:

  • How to test Microphone
  • How to record audio via microphone
  • How to play recorded audio

How to test microphone on Linux

How to test microphone on Linux

Software Requirements and Conventions Used

Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Any GNU/Linux distribution
Software Alsa
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

How to test microphone step by step instructions



  1. First step is obtain a list of all microphone devices. To do so execute:
    # arecord -l
    **** List of CAPTURE Hardware Devices ****
    card 0: PCH [HDA Intel PCH], device 0: ALC662 rev3 Analog [ALC662 rev3 Analog]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    card 0: PCH [HDA Intel PCH], device 2: ALC662 rev3 Alt Analog [ALC662 rev3 Alt Analog]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    card 1: Q9000 [QuickCam Pro 9000], device 0: USB Audio [USB Audio]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    
  2. Next record a short 10 seconds audio by using the following command:
    # arecord -f S16_LE -d 10 -r 16000 --device="hw:1,0" /tmp/test-mic.wav
    

    In the above example we have recorded audio via microphone using the QuickCam Pro 9000 as specified by --device="hw:1,0" as in card 1 and device 0 from the arecord -l output in the previous step.

  3. Now confirm that the source was recorded correctly using aplay:

    # aplay /tmp/test-mic.wav
    


Comments and Discussions
Linux Forum