Difference between revisions of "To use USB mini microphone on Raspbian"

From Wiki
Jump to: navigation, search
(FAQ)
 
(5 intermediate revisions by the same user not shown)
Line 57: Line 57:
 
Record for three seconds and play it  
 
Record for three seconds and play it  
  
  arecord -D plughw:1,0 -d 3.0 test.wav && aplay test.wav
+
  arecord -D plughw:1,0 -d 3 test.wav && aplay test.wav
  
 
[[File:mk6.jpg]]
 
[[File:mk6.jpg]]
Line 91: Line 91:
 
After adjusting, record again:  
 
After adjusting, record again:  
  
  arecord -D plughw:1,0 -d 3.0 test.wav && aplay test.wav
+
  arecord -D plughw:1,0 -d 3 test.wav && aplay test.wav
  
 
Enjoy!
 
Enjoy!
 
=='''FAQ'''==
 
=='''FAQ'''==
===Q1: Not working with raspberry pi (raspbian) and also not working with Windows 7, it doesnt detect a single sound.===
+
===Q1:Microphone doesn't work or defective.===
Not working 具体表现是什么呢?
+
<p>You can open the Audio Device Settings in the Raspberry Pi.</p>
在树莓派上你可以打开Audio Device Settings,
+
[[File:AD Settings.png]]<br>
然后在Sound Card一项的下拉菜单看到USB PNP Sound Card
+
<p>then you can see the USB PNP Sound Card in the drop-down menu of the Sound Card.</p>
选择后,默认下方没有显示任何设置,你需要点击Select Controls
+
[[File:Sound Card.png]]<br>
然后勾选两个控制, 再点击Close关闭页面
+
<p>After selecting, the default below does not show any settings, you need to click Select Controls, and check the two controls, then click Close to close the page.</p>
这时你就可以看到两个Tab, Capture 和Switches
+
[[File:Select Controls.png]]<br>
把Capture的音量调到最大,并点击ok关闭设置
+
<p>Now, you can see two Tabs, Capture and Switches. You can set the volume of Capture to the max, and click OK to close the setting.</p>
 
+
[[File:Capture Switches.png]]<br>
测试:
+
<br>
现在你可以打开Terminal,输入命令 arecord -l
+
[[File:volume.png]]<br>
可以看到USB PnP Sound Device
+
<p>Test:<br>
 
+
You can open the Terminal and enter command arecord -l, then you will get USB PnP Sound Device.<br>
然后输入命令:
+
Then enter the command:<br>
arecord -D plughw:1,0 -d 3 test.wav
+
arecord -D plughw:1,0 -d 3 test.wav<br>
就可以录制3秒的声音并储存到test.wav
+
You can record 3 seconds of sound and save to test.wav, next you can use aplay test.wav to listen to it.<br>
然后可以使用aplay test.wav来听
+
</p>
 +
[[File:Test.png]]<br>

Latest revision as of 01:22, 3 May 2018

Introduction

Mkdd1.jpg

This is a tiny USB Microphone that plugs into your laptop or desktop computer. No microphone on your computer? No problem - just plug this incredibly small microphone into a USB port and add microphone functionality. No need to install any extra software; Microsoft Windows will detect the device and automatically install it. Simply launch within any program such as Skype or Google Hangouts.

There is no need to configure the USB mini microphone, it can be used directly. You can also use it in Rasperry Pi which has been burned with Raspbian, Here are the steps.

Components

-Raspberry Pi

-A TF card burned with the Raspbian

-5V DC power adapter, 2A or above with micro USB interface

-HDMI interface display (or VGA interface display with a VGA to HDMI adaptor)

-USB mouse and keyboard

-Speakers or headphones in the standard of 3.5mm

-USB mini microphone

Steps

Step1: Ready to start the Raspberry Pi and insert the mini microphone module as well as audio/headphones.

Open the Terminal of the Raspberry Pi

Mddk2.jpg

Step2: Check the USB connection

Enter the following commands to check the usb connection

lsusb

You can see the USB devices connected by the Raspberry Pi

Mddk3.jpg

“C-Media Electronics, Inc. CM108 Audio Controller” is the USB mini microphone. Check the microphone with arecord

arecord -l

(“l” is lower “L”). You will see the recording device:

Ddmk4.jpg

You will see device card1, device0. Use plughw:1,0 to represent.

Mk5.jpg

Step3: Records testing

Record for three seconds and play it

arecord -D plughw:1,0 -d 3 test.wav && aplay test.wav

Mk6.jpg

Here we use arecord to record and aplay to play;“-D” to choose the device and “-d” to set the recording time

You can input “arecord --help” and “aplay --help” for details.

If the sound is low, you can adjust the gain of the microphone.

Step4: Adjust the gain of the microphone

Open the Audio Device Settings: Open the Menu in the top left corner, and go through Preferences => Audio Device Settings.

Mk7.jpg

Choose USB PnP Sound Device(Alsa mixer)in the Sound card column. It there appears No controls visible, open the Select Controls in the lower left corner.

Mk8.jpg

Tick the Microphone in the Select Controls page and click Close in the lower right corner.

Mk9.jpg

At this time, No controls visible in the middle of the Audio Device Settings page becomes Capture.

Adjust the slider below to adjust the gain of the microphone.

Mk10.jpg

After adjusting, record again:

arecord -D plughw:1,0 -d 3 test.wav && aplay test.wav

Enjoy!

FAQ

Q1:Microphone doesn't work or defective.

You can open the Audio Device Settings in the Raspberry Pi.

AD Settings.png

then you can see the USB PNP Sound Card in the drop-down menu of the Sound Card.

Sound Card.png

After selecting, the default below does not show any settings, you need to click Select Controls, and check the two controls, then click Close to close the page.

Select Controls.png

Now, you can see two Tabs, Capture and Switches. You can set the volume of Capture to the max, and click OK to close the setting.

Capture Switches.png

Volume.png

Test:
You can open the Terminal and enter command arecord -l, then you will get USB PnP Sound Device.
Then enter the command:
arecord -D plughw:1,0 -d 3 test.wav
You can record 3 seconds of sound and save to test.wav, next you can use aplay test.wav to listen to it.

Test.png