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.
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.
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! :-)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments