element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Rocking Raspberry Pi
  • Challenges & Projects
  • Design Challenges
  • Rocking Raspberry Pi
  • More
  • Cancel
Rocking Raspberry Pi
Blog Raspberry Pi and Karaoke Machine (Setting Up Microphone)
  • Blog
  • Forum
  • Documents
  • Files
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: babusingh9211
  • Date Created: 15 Mar 2014 9:53 AM Date Created
  • Views 2611 views
  • Likes 1 like
  • Comments 0 comments
  • raspi
  • rockingraspberrypi
  • raspberry-pi
  • rocking_pi
Related
Recommended

Raspberry Pi and Karaoke Machine (Setting Up Microphone)

babusingh9211
babusingh9211
15 Mar 2014

Hello everyone,

 

Before I start, I am excited to know you about that the expected idea which is written in my roadtest application is almost done with few bugs. I am still working to fix the issues. I’ll post my about that in next post. But before that it is important to setup microphone in order to make a karaoke machine. So I’ve decided to post explaining “how I setup the microphone?”.

 

 

At first I buy a USB Sound Card from local market it works fine only for output audio but while using it as input through the microphone it works horrible. It works somehow fine in my laptop.


I’ve searched for the solution and also asked about the problem with some of my friend. They said that it might be an issue because of low output current capabilities of the raspberry pi.


So I’ve bought a new USB power hub. But the problem was still not gone. At last at very frustrated moment I bought a new USB sound card again from local market but from different shop. After using that I got to know that the old USB sound card is faulty. And wasted my money on that and buying extra power USB hub. So I have decided to post my story so that you will not waste your money.

 

Now come to the technical things.

 

How to use USB sound card

 

Step1. Plug USB sound card to the Raspberry Pi USB port.

Step2. Plug the microphone to the USB Sound card microphone jack. ( I’ve cut the 3.5mm jack from the old spare earphone and soldered the condenser microphone to it.)

Step3. (Optional) Plug the speaker USB sound card output or to the Raspberry Pi audio output jack.

 

Now, In the Raspberry Pi’s terminal

  cat /proc/asound/cards

  cat /proc/asound/modules

This is my output before and after plugging USB sound card

 

imageimage

 

Recording and Playback

 

As in the image previously my device 0 (default sound device) is ALSA and the device 1 is USB-Audio

 

Recording Sound

                                                 

arecord -d 3 -D plughw:1,0 testsound.wav

 

This will record your audio for 3 second to the file name testsound.wav.

You can change plughw:0,0 if your default device is USB-Audio

 

Playing sound

 

aplay testsound.wav

 

This will play sound to the default audio output. In mine case the default audio output is ALSA.

 

In order to play sound over the USB-Audio

 

aplay –D plughw:1,0 testsound.wav

 

image

Combining all things together

 

Lets create a shell script

 

sudo nano testsound.sh

 

Enter following to the file and save changes

 

            echo “Say something within 5 Second”

arecord -d 5 -D plughw:1,0 testsound.wav

echo “Playing Recording”

aplay -D plughw:1,0 testsound.wav

 

Make the file executable

 

sudo chmod +x testsound.sh

 

Execute the script

 

./testsound.sh

 

image

 

This is all for now.

If you have any problem and query regarding this don’t hesitate to ask. If you have any suggestion’ please comment below.

 

Regards,

Sumit Rai

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube