Lexin Esp32 journey of learning to learn 16 local offline voice recognition wake framework esp-skainet, how to modify the wake word? How to customize the command word? How do the intended action?


  • This series of blog study by the non-official and a half stars heart painstaking written by force, just do personal technology exchange and sharing, without any commercial purposes. If wrong, please leave a message, I promptly changed.

1, climb pit learn new journey, a virtual machine set up esp32 development environment, print "Hellow World". 2. Using eclipes editor, official tutorials to build esp32 development environment under Windows, print "Hellow World". 3, the basic understanding of esp32 GPIO interface, first began to light up your LED lights and interrupt callback implement key functions. 4, timer function esp32 strong experience, and a realization timing 2s blinking LED. 5, the contact width of the pulse function esp32 pwm practice, to achieve the effect of breathing lights flashing an LED. 6, smartConfig and implemented in the micro-channel airKiss esp32, a key distribution network quick and easy connection to the router. 7, using the GPIO interrupt to do a short press of the button and press the callback, no longer need to worry about triggering source. 8, to achieve local UDP client and server roles on esp32, realize the communication in the LAN. 9, to achieve local TCP client and server roles on esp32, reconnection can backtrack data. 10, using the programming Lexin esp32 SDK rmt drive ws2812 colorful lights, a rainbow gradient achieved. 11, entry Lexin esp-adf audio framework development, esp32 create a Bluetooth headset, switch songs achieve, get song information and other functions. 12, open a micro-channel public number airkiss esp32 distribution network and local area network discovery project, to share a airkiss distribution network gadgets. 13, esp32 built dns server, without having to access the external network domain returns the specified page. After 14, esp32 sdk programming portals mandatory certification, connections esp32 hotspots, automatically force a specified login screen pops up.













15, recognize the local offline speech recognition wakeup frame esp-skainet, low-cost hardware local voice recognition control. 16, learning the local offline voice recognition wake framework esp-skainet, how to modify the wake word? How to customize the command word? How do the intended action? 17, starting the whole network, Lexin esp32 sdk Direct Connect Beijing Jingdong Microunion Small fish · IoT open platform, ding-dong sound intelligent voice control.



Here Insert Picture Description

I. Introduction;


     The day before yesterday, I shared in the blog entry how esp-skainetmany group of friends are interested in, today is two-eleven, today cut your hands yet? I was ready to knock honestly follow the code? Continue to learn the local offline voice recognition wake of this framework?

     Recently he found himself a little astigmatism, and very painful, have to go with glasses or visual inspection, and if given the opportunity, I will not do "program ape" sedentary front of the computer is not regular exercise;


Second, modify wake-word;


     I said earlier, wake up is only a few words, given the commercial issues, the official opening will come out only a few, including "Hi Lexin," "Hello little wisdom" ... ... and several, then how do we modify self Defines the wake word it?

     Open the project configuration make menuconfig, you can see only from below "Hi Lexin," "Hello little wisdom" This two wake-up word; wake-English word, have to wait for the official website added to it;

      Enter Component config-> ESP Speech Recognition, follow the instructions configure the following parameters:

  • Wake word engine: Select WakeNet 5 (quantized);
  • Wake word name: Choose hilexin (WakeNet5)or other wake-up word
  • speech commands recognition model to us: Select MultiNet 1 (quantized);
  • langugae: Select chinese (MultiNet1);

Here Insert Picture Description


Third, modify the command word;


     修改命令词是什么意思?比如我要它识别到 “我要开空调”、“我要开飞机”、“我要开推土机”,然后把识别后的意图转化为代码做对应的动作;

     上篇博文说了,自定义命令词仅仅支持 100 个,而且目前为止只是中文词汇,非英文词汇,很好!

     目前,MultiNet 模型中已经预定义了四个命令词。用户可以通过 menuconfig -> Component config -> ESP Speech Recognition -> Add speech commands and The number of speech commands来定义自己的语音命令词和语音命令的数目。注意,在填充命令词时应该使用拼音,并且每个字的拼音拼写间要间隔一个空格。比如“打开空调”,应该填入 “da kai kong tiao”.

  • 一个语音命令 ID 可以对应多条语音指令短语;
  • 最多支持 100 个语音命令 ID 或者命令短语;
  • 同一个语音命令 ID 对应的多条语音指令短语之间要使用“,”隔开
  • 比如下面的动图,我做了5个语音命令 ID12个命令短语

Here Insert Picture Description


四、搭建针对语音命令的动作函数


     用户可以通过 void speech_commands_action(int command_id) 函数定义针对每个语音命令的动作,因为前面我们看到了每个命令短语对应一个ID,所以,识别出来的结果,我们判断id就知道它的意图是什么了,比如:


void speech_commands_action(int command_id)
{
    printf("Commands ID: %d.\n", command_id);
    switch (command_id)
    {
    case 0:
        printf("开灯 \n");
        led_on(CW_LED_GPIO);
        led_on(WW_LED_GPIO);
        break;
    case 1:
        printf("关灯 \n");
        led_off(CW_LED_GPIO);
        led_off(WW_LED_GPIO);
        break;
    case 2:
        printf("冷色光\n");
        led_on(CW_LED_GPIO);
        led_off(WW_LED_GPIO);
        break;
    case 3:
        printf("暖色光\n");
        led_off(CW_LED_GPIO);
        led_on(WW_LED_GPIO);
        break;
    case 4:
        printf("中性光\n");
        led_on(CW_LED_GPIO);
        led_on(WW_LED_GPIO);
        break;
    default:
        break;
    }
}

五、其他


5.1 编译和运行

运行 make flash monitor 来编译烧写该示例,并且检查以下输出打印:

Quantized wakeNet5: wakeNet5_v1_hilexin_5_0.95_0.90, mode:0
Quantized MN1
I (153) MN: ---------------------SPEECH COMMANDS---------------------
I (163) MN: Command ID0, phrase 0: da kai kong tiao
I (163) MN: Command ID1, phrase 1: guan bi kong tiao
I (173) MN: Command ID2, phrase 2: da kai dian deng
I (173) MN: Command ID3, phrase 3: guan bi dian deng
I (183) MN: ---------------------------------------------------------

chunk_num = 200
-----------awaits to be waken up-----------

5.2 唤醒板子

可以通过板子的输出打印找到支持的唤醒词。在这个示例中,唤醒词是 “Hi Lexin" [Ləsɪ:n].

然后,说出 “Hi Lexin" ([Ləsɪ:n]) 来唤醒板子,唤醒后打印如下信息:

hilexin DETECTED.
-----------------LISTENING-----------------

5.3 语音命令词识别

然后,板子会进入侦听状态,等待语音命令词。

Currently, MultiNet has 20 predefined word, you can refer MultiNet .

  • If the command word is present in the command word in the list, back to print the following log:

    -----------------LISTENING-----------------
    
    phrase ID: 0, prob: 0.866630
    Commands ID: 0
    
    -----------awaits to be waken up-----------
    
    
  • If the command word does not exist in the command word in the list, back to print the following log:

    -----------------LISTENING-----------------
    
    cannot recognize any speech commands
    
    -----------awaits to be waken up-----------
    
    

When the end of the current board of the recognition process and enters the wake-up wait state, it will print:

-----------awaits to be waken up-----------

Also, do not put my blog as learning standards, I just note that there was little negligently, if so, please point it out, welcome message Ha! Plus group also welcomed the discussion!

  • Fun esp8266with you fly, plus group paid QQgroup, friends do not like do not spray Do not add: 434 878 850
  • esp8266 source code learning Summary (continuously updated, welcome star): https: //github.com/xuhongv/StudyInEsp8266
  • esp32 source code learning Summary (continuously updated, welcome star): https: //github.com/xuhongv/StudyInEsp32
  • Watch the following micro-channel public number two-dimensional code, a lot of dry goods, the first time to push!
Published 152 original articles · won praise 785 · views 790 000 +

Guess you like

Origin blog.csdn.net/xh870189248/article/details/103010561