# Elechouse Voice Recognition Module V3.1 and Arduino - Setup and Tutorial

https://www.youtube.com/watch?v=YZ0SOAFXVAQ
Translation: zh-CN

[00:00] on.
  开。

[00:01] on off.
  开关。

[00:03] off hi this is Dr Ben finnio with science.
  关大家好，我是本·芬尼奥博士，来自科学。

[00:05] hi this is Dr Ben finnio with science buddies and in this video I'll show you.
  大家好，我是本·芬尼奥博士，来自科学伙伴，在本视频中，我将向您展示。

[00:07] buddies and in this video I'll show you how to set up voice recognition with an.
  伙伴，在本视频中，我将向您展示如何设置语音识别与一个。

[00:09] how to set up voice recognition with an Arduino and the elec house voice.
  如何设置语音识别与一个Arduino和Elec House语音。

[00:11] Arduino and the elec house voice recognition module V3.
  Arduino和Elec House语音识别模块V3。

[00:13] recognition module V3 let's start by taking a look at the.
  识别模块V3，让我们先来看看。

[00:15] let's start by taking a look at the module there are several different ways.
  让我们先来看看模块，有几种不同的方式。

[00:17] module there are several different ways it can communicate with the Arduino but.
  模块，它可以与Arduino进行通信，但有几种不同的方式。

[00:19] it can communicate with the Arduino but the manual recommends using the TX and.
  它可以与Arduino进行通信，但手册建议使用TX和。

[00:20] the manual recommends using the TX and RX pins for full functionality it does.
  手册建议使用TX和RX引脚以获得全部功能，它确实。

[00:23] RX pins for full functionality it does not come with header pins attached so.
  RX引脚以获得全部功能，它不带附带的排针，所以。

[00:25] not come with header pins attached so you will need to solder those on.
  不带附带的排针，所以你需要自己焊接它们。

[00:26] you will need to solder those on yourself so you can use it with a.
  你需要自己焊接它们，这样你就可以用它与一个。

[00:28] yourself so you can use it with a breadboard it also comes with a small.
  自己，这样你就可以用它与一个面包板，它还带有一个小的。

[00:30] breadboard it also comes with a small microphone that you can plug into the.
  面包板，它还带有一个你可以插入的麦克风。

[00:32] microphone that you can plug into the microphone Jack here.
  麦克风，你可以插入这里的麦克风插孔。

[00:35] microphone Jack here once you've put it in the breadboard you.
  麦克风插孔，一旦你把它放在面包板上，你。

[00:37] once you've put it in the breadboard you have four pins to connect to your.
  一旦你把它放在面包板上，你有四个引脚可以连接到你的。

[00:38] have four pins to connect to your Arduino with jumper wires the ground pin.
  有四个引脚可以通过跳线连接到你的Arduino，接地引脚。

[00:41] Arduino with jumper wires the ground pin is going to go to the arduino's ground.
  Arduino，通过跳线，接地引脚将连接到Arduino的接地端。

[00:43] is going to go to the arduino's ground the VCC pin is going to go to the.
  将连接到Arduino的接地端，VCC引脚将连接到。

[00:46] the VCC pin is going to go to the arduino's 5 volts the RX pin will go to.
  VCC引脚将连接到Arduino的5伏特，RX引脚将连接到。

[00:50] arduino's 5 volts the RX pin will go to Arduino pin 3 and the TX pin will go to.
  Arduino的5伏特，RX引脚将连接到Arduino的3号引脚，TX引脚将连接到。

[00:54] Arduino pin 3 and the TX pin will go to Arduino pin 2. note that pins two and.
  Arduino的3号引脚，TX引脚将连接到Arduino的2号引脚。请注意，引脚二和。

[00:56] three are what's used in the example.
  三号引脚在示例中使用。

[00:59] three are what's used in the example program that is provided but you can.
  三号引脚在提供的示例程序中使用，但你可以。

[01:00] program that is provided but you can change these pins in the software later.
  提供的程序，但您可以在以后在软件中更改这些引脚。

[01:04] change these pins in the software later that is it for the hardware setup let's switch over to the computer and look at setting up the software.
  在软件中更改这些引脚，硬件设置就到这里了，让我们切换到计算机并查看软件设置。

[01:09] the first thing you will need to do is head over to their website you can find that link in the description of this video and download the Arduino Library.
  您需要做的第一件事是访问他们的网站，您可以在此视频的描述中找到该链接并下载 Arduino 库。

[01:17] once you've downloaded that zip file extract it to your Arduino libraries folder on your computer and you should have a folder called voice recognition B3.
  下载完该 zip 文件后，将其解压缩到您计算机上的 Arduino 库文件夹，您应该会看到一个名为 voice recognition B3 的文件夹。

[01:27] once you've installed the library open the Arduino IDE then select file examples voice recognition V3 VR sample train.
  安装完库后，打开 Arduino IDE，然后选择文件 -> 示例 -> voice recognition V3 -> VR sample train。

[01:40] once you've opened the program make sure you have the correct Arduino board and com Port selected then upload it to your Arduino.
  打开程序后，请确保您已选择正确的 Arduino 板和 com 端口，然后将其上传到您的 Arduino。

[01:49] after the program has finished uploading select tools serial monitor and make sure the baud rate is set to 115 200.
  程序上传完成后，选择工具 -> 串行监视器，并确保波特率设置为 115200。

[02:01] in the serial monitor you will see a list of commands that you can use to control the voice recognition module.
  在串行监视器中，您将看到一个可用于控制语音识别模块的命令列表。

[02:07] to train a voice recognition command type train and then a number that will be the index of the command.
  要训练语音识别命令，请输入 train，然后输入将是该命令索引的数字。

[02:15] note that the module can store up to 80 commands total but only 7 can be active at one time.
  请注意，该模块总共可以存储多达 80 个命令，但一次只能激活 7 个。

[02:22] see the manual for more details.
  有关更多详细信息，请参阅手册。

[02:23] I am going to type train 0 because the index starts at zero.
  我将输入 train 0，因为索引从零开始。

[02:28] press enter and then follow the on-screen prompts to speak the command.
  按 Enter 键，然后按照屏幕上的提示说出命令。

[02:33] it will try to get two matching recordings of the command before finishing.
  它将在完成之前尝试获取该命令的两个匹配录音。

[02:36] if it has trouble matching the commands it will prompt you to continue speaking.
  如果它在匹配命令时遇到困难，它会提示您继续说话。

[02:48] once you have recorded two successful matches of the command it will stay success and that that record is trained.
  一旦您成功匹配了该命令两次，它将显示成功，并且该记录已训练好。

[02:55] I am now going to do the same thing to train the word off for record one.
  我现在将做同样的事情来训练单词“off”，用于记录一。

[03:02] off.
  关。

[03:08] And just to give an example of what that might look like if you mess up, let's try record two.
  举个例子，如果你搞砸了会是什么样子，我们来试试录制二。

[03:13] And I'm going to use the word hello for this one.
  这次我将使用“你好”这个词。

[03:15] Hello for this one.
  这次是“你好”。

[03:18] Hello.
  你好。

[03:36] So there we go, don't panic if it doesn't work on the first two tries.
  好了，如果前两次不成功，不要惊慌。

[03:39] It will continue prompting you to speak until it gets a match.
  它会继续提示你说话，直到匹配成功。

[03:44] After you have trained the commands, type load followed by the indices of the commands that you have trained.
  训练完命令后，输入“加载”，然后输入你训练过的命令的索引。

[03:46] So I'm going to do 0 space 1 space 2.
  所以我要输入 0 空格 1 空格 2。

[03:50] Press enter.
  按回车。

[03:54] Those commands are now loaded and I can test them.
  这些命令现在已加载，我可以测试它们了。

[03:56] I can test them on.
  我可以测试它们。

[03:59] On.
  开。

[04:01] Off.
  关。

[04:03] Off hello.
  关，你好。

[04:05] Hello on.
  你好，开。

[04:07] On, so you see that when I speak each command and it is successfully recognized, the serial monitor will print out the index that I have stored that command in.
  开，所以你看到当我发出每个命令并且它被成功识别时，串行监视器将打印出我存储该命令的索引。

[04:16] Now let's use those commands to do something.
  现在让我们使用这些命令来做些事情。

[04:18] You can use an example program to just control the built-in LED on the Arduino.
  你可以使用一个示例程序来控制Arduino上的内置LED。

[04:22] So again, go to file examples, voice recognition V3, and select VR sample control LED.
  所以再次，转到文件，示例，语音识别V3，然后选择VR示例控制LED。

[04:29] I am not going to go through this entire program.
  我将不详细介绍整个程序。

[04:33] We are just going to look at two key parts.
  我们只看两个关键部分。

[04:35] First, notice how it defines constants related to the indices where you have the records or commands stored.
  首先，注意它如何定义与你存储记录或命令的索引相关的常量。

[04:40] Remember that we have 'on' stored in index one and 'off' stored in index two.
  记住我们有存储在索引一中的“开”和存储在索引二中的“关”。

[04:44] If we scroll down to the bottom of the program, we will see there is a switch case statement that uses digital write to turn the LED on or off depending on which record it detects.
  如果我们滚动到程序的底部，我们将看到有一个开关情况语句使用数字写入来根据检测到哪个记录来打开或关闭LED。

[04:57] So if we upload this program and switch back over to our Arduino, we should be.
  所以如果我们上传这个程序并切换回我们的Arduino，我们应该。

[05:04] Back over to our Arduino, we should be able to speak the words on and off to control the onboard LED.
  回到我们的Arduino，我们应该能够说出“开”和“关”这两个词来控制板载LED。

[05:08] The Arduino's onboard LED is pretty tiny.
  Arduino的板载LED非常小。

[05:11] Take a look right there and let's test it out on.
  看那里，我们来测试一下“开”。

[05:15] Off.
  关。

[05:17] On.
  开。

[05:19] Off.
  关。

[05:21] On.
  开。

[05:23] Now, you will definitely not have a 100% success rate with this since it is running locally on the Arduino.
  现在，你用这个肯定不会有100%的成功率，因为它是在Arduino上本地运行的。

[05:25] This is much less powerful than something like a cloud speech to text service from Google or Amazon.
  它比谷歌或亚马逊的云语音转文本服务之类的东西功能要弱得多。

[05:32] And it is speaker dependent.
  而且它是依赖说话人的。

[05:35] It is trained to recognize the exact sound clip of you speaking that word.
  它被训练来识别你说话那个词的确切声音片段。

[05:37] So if somebody else comes along and says on or off, it is not going to recognize their voice.
  所以如果别人来说“开”或“关”，它将无法识别他们的声音。

[05:46] The success can also depend heavily on factors like background noise and the distance from the microphone.
  成功率还可能在很大程度上取决于背景噪音和离麦克风的距离等因素。

[05:48] Let's see what happens if I move a little farther away.
  让我们看看如果我稍微离远一点会发生什么。

[05:55] On.
  开。

[05:57] Off.
  关。

[05:59] On.
  开。

[06:01] On.
  开。

[06:06] and then if I get closer again on off.
  然后，如果我再次靠近，打开，关闭。

[06:07] off on.
  关闭，打开。

[06:09] on off.
  打开，关闭。

[06:11] off on.
  关闭，打开。

[06:12] on so again you can see the success rate is.
  打开，所以再次可以看到成功率是。

[06:14] so again you can see the success rate is not 100 percent.
  所以再次可以看到成功率不是百分之百。

[06:16] not 100 percent however this is still a pretty quick and.
  不是百分之百，但是这仍然是一种相当快速和。

[06:19] however this is still a pretty quick and easy way to get voice recognition.
  但是这仍然是一种相当快速简便的语音识别方法。

[06:20] easy way to get voice recognition working on an Arduino that does not.
  简便的方法即可在不带互联网连接的Arduino上实现语音识别。

[06:22] working on an Arduino that does not require an internet connection.
  不要求互联网连接即可在Arduino上实现语音识别。

[06:24] require an internet connection for written instructions to set this up.
  需要互联网连接才能进行设置的书面说明。

[06:26] for written instructions to set this up and instructions for controlling.
  用于设置的书面说明以及用于控制的说明。

[06:28] and instructions for controlling external hardware like appliances that.
  以及用于控制外部硬件（如需要插入墙壁插座的电器）的说明。

[06:30] external hardware like appliances that must plug into a wall outlet check out.
  需要插入墙壁插座的外部硬件（如电器），请查看。

[06:32] must plug into a wall outlet check out the links in the description of this.
  必须插入墙壁插座，请查看此视频描述中的链接。

[06:33] the links in the description of this video.
  视频描述中的链接。

[06:34] video on.
  视频，关于。

[06:36] on off.
  打开，关闭。

[06:37] off for thousands of other fun Hands-On.
  关闭，数千个其他有趣的实践。

[06:39] for thousands of other fun Hands-On science and engineering projects visit.
  数千个其他有趣的实践科学和工程项目，请访问。

[06:41] science and engineering projects visit us online at www.sciencebuddies.org.
  科学和工程项目，请在线访问我们的网站 www.sciencebuddies.org。
