arecord 및 aplay 사용방법12 Aug 2017 | 라즈베리파이 리눅스 Show alsa-utils 설치사운드를 녹음하는
명령어로 두 프로그램을 설치할 수 있습니다. arecord 사용법
aplay 사용법위에서 녹음한 파일을 재생할 때는 다음과 같은 옵션으로 재생하면 됩니다.
옵션이 의미하는 바는 만약 으로 실행해도 됩니다. At least with the CM-Headphone type adapter, you can also record audio. Will record signed 16-bit ( You can have a little VU meter show up if you add to the
Once you're done recording you can play back with
This guide was first published on Sep 17, 2013. It was last updated on Sep 17, 2013. This page (Recording Audio) was last updated on Oct 26, 2022. Text editor powered by tinymce. Recording audio with the Raspberry Pi opens up a wide variety of audio-based applications like voice recognition, voice control, and security systems.
In this tutorial, we will walk through the steps of setting up a USB microphone on the Raspberry Pi, then see how to record audio from the microphone. How to Connect a Microphone to the Raspberry PiThere are four ways you can connect a microphone to the Raspberry Pi:
External Sound CardThe first option is to connect a microphone through the microphone jack on an external sound card like the Audio Injector Sound Card. This is a Raspberry Pi HAT that sits on top of the Raspberry Pi. The microphone can be connected to the sound card with standard RCA plugs. This method will give the best audio quality. BluetoothThe second way to connect a microphone to the Raspberry Pi is with Bluetooth. Bluetooth microphones are the most seamless way to add a microphone as they don’t require a physical connection. Compatibility issues and unpredictable audio quality are downsides to using Bluetooth microphones. But the convenience of having a wireless microphone might make them worthwhile. USBUSB microphones are probably the most reliable way to record audio with a Raspberry Pi. They are mostly plug and play, and work without any additional hardware or software. The sound quality of USB microphones can range from poor to professional quality. It all depends on the quality of your microphone. For example, a Blue Yeti USB microphone (around $100) records much higher quality sound than a generic USB microphone ($15). How to Record Audio From the MicrophoneSetting up a USB microphone using the Raspberry Pi Desktop is easy. Once you connect the microphone to the Raspberry Pi, the microphone will be detected automatically. Recording Audio From the DesktopTo record audio from the desktop, open the Audio Device Settings by going to Preferences > Audio Device Settings. There you can change the microphone amplification with a handy slide controller. Press the red record button to start recording audio: Recording Audio From the Command LineTo record audio from the command line, first check the USB microphone’s connection by entering the following command:
You should see an output similar to this:
To see the list of audio input devices, enter:
This output should be shown: So the microphone matches with card 1 and device 0. This will be mapped in the following with Finally, we can start recording audio by entering the following command:
The term The following output should appear: AlsamixerSometimes the volume of the recording will be low. In these cases, Alsamixer can helps us manage the microphone volume with a simple interface. To open Alsamixer, type the following into the Raspberry Pi terminal:
You’ll see the default console: Now, you have to switch to the correct audio device by pressing F6: In my case, the correct sound card is the one marked as bcm2835 ALSA: Now you can use the up and down arrow keys to change the volume of the microphone as needed. Press ESC to save and exit. Hope this has helped you figure out how to record audio on the Raspberry Pi! Leave a comment below if you have questions about anything.
|