简体   繁体   English

我可以使用Raspberry Pi 3(B型)中的AUX端口插入麦克风以获取音频信号吗?

[英]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. 当我在树莓派3(模型B)中的Python中运行此代码时,它出现以下错误。

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? 我需要有一个USB麦克风来获取音频信号,而不是在耳机中使用麦克风吗?

< /Hey > </嘿>

As designed by the Raspberry Pi's circuit layout, in short: 简而言之,正如Raspberry Pi的电路布局所设计的:

The 3.5mm Audio Jack on the Raspberry Pi models cannot be used as an audio input. Raspberry Pi型号上的3.5毫米音频插孔不能用作音频输入。

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) 1.使用小型麦克风阵列(例如Alexa Echo或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 ). 很多时候,这类系统是在Raspberry Pi或类似系统上进行原型制作的(请参阅官方的Alexa开发套件 )。 You can find similar replicas to the microphone arrays found on google home etc. , specifically fitted for the Raspberry Pi. 您可以找到与Google Home等上的麦克风阵列类似的副本,这些副本特别适合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): 这是我在Google上搜索后找到的3个(我确定您是否可以找到更多):

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 2.使用普通的USB麦克风

Probably the most common approach is to get a standard USB microphone that has Raspberry Pi drivers and use this. 可能最常见的方法是使用具有Raspberry Pi驱动程序的标准USB麦克风。 I found one from Adafruit which I'm sure is just plug and play which could be nice and easy to get going with. 我从Adafruit找到了一个,我敢肯定它只是即插即用,可能很好用,而且很容易上手。

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. 您可以使用的是USB microphone ,这些USB microphone可以安装所需的驱动程序,并且更易于使用。

Source: https://www.raspberrypi.org/forums/viewtopic.php?t=188108 资料来源: https : //www.raspberrypi.org/forums/viewtopic.php?t=188108

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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