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
Software Requirements and Conventions Used
| 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
- 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
- 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 incard 1anddevice 0from thearecord -loutput in the previous step. -
Now confirm that the source was recorded correctly using
aplay:# aplay /tmp/test-mic.wav
