简体   繁体   中英

Can I use AUX port in Raspberry Pi 3 (Model B) to plug a microphone to get audio signals in?

import speech_recognition as sr

r = sr.Recognizer()
with sr.Microphone() as source:
    audio = r.listen(source)

print(r.recognize_sphinx(audio))

When I run this code in Python in raspberry pi 3 (model B), it gives the following error.

OSError: No Default Input Device Available

what is the reason for this? do I need to have a USB microphone to get the audio signals in rather than using the microphone in earphones?

< /Hey >

As designed by the Raspberry Pi's circuit layout, in short:

The 3.5mm Audio Jack on the Raspberry Pi models cannot be used as an audio input.

I'm not sure if you would want to anyways.

This means you have a couple of options on how you want to set up your microphone setup.

1. Using a small mic array (Like Alexa Echo or Google Home)

A lot of the time these kind of systems are prototyped on Raspberry Pi's or similar (see the official Alexa development kit ). You can find similar replicas to the microphone arrays found on google home etc. , specifically fitted for the Raspberry Pi. These include some added advanced features such as Noise Suppression, Direction of Sound Source and other neat features I'll leave for you to explore yourself.

Here's 3 I found after googling (I'm sure if you look you can find more):

If you wanted high quality results for speech recognition I'd probably begin to look more down this route.

2. Using a normal USB microphone

Probably the most common approach is to get a standard USB microphone that has Raspberry Pi drivers and use this. I found one from Adafruit which I'm sure is just plug and play which could be nice and easy to get going with.

Again I'm sure you'll find plenty of other options online, these were just suggestions to get you started.


Hopefully this helps! :-)

What you could use is a USB microphone , these tend to install the required drivers and work out of the box more easily.

Source: https://www.raspberrypi.org/forums/viewtopic.php?t=188108

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM