Unity study notes - introduce VAD voice detection into Unity for calling (Android version)

Unity study notes


As in the title, the voice wake-up function was done last year, but because I don’t know how to detect whether someone is talking, this function is basically useless. I recently found a tutorial on using VAD for voice detection. I tried it and studied it. Three or four months (counting from the beginning of seeing this tutorial), I finally realized that after using Baidu's voice wake-up, I called vad for voice detection and simultaneous voice recording. The voice data is sent to the corresponding artificial intelligence interface for intelligent dialogue.
First of all a Baidu voice wake-up is required. I won’t re-write this previous post
. I will focus on vad

https://yeyupiaoling.blog.csdn.net/article/details/105553265

For time reasons, I set up the vad environment according to the steps in the post, but because it involves C language, many methods and parameters are very hoodwinked, and I don’t know why the error is reported, so I directly used the one that was broken down in the tutorial Vad source code (one is all, one is specifically for human voice detection in vad)

As shown in the figure below, the key structure is framed
insert image description here

The main thing we want to use is the vad folder, and the others are the environments needed for the program to run

The idea is probably to call vad's voice detection after the voice wakes up, and turn on the voice recording at the same time, and then turn off the voice recording after the vad's voice detection is over, and at the same time send a message to the required interface/method. Let's write so much first. Other precautions
insert image description here
insert image description here
follow rewrite

2022.7.2 To update
Baidu’s wake-up sdk, you need to add the package name of the corresponding wake-up program on the official website. If you are like me and use it in unity, and then integrate it with the original app, the package name you add on the official website is It needs to be the package name of the integrated app. Like mine, Unity is packaged for native integration. Then the package name related to wake-up on the official website needs to be the package name of the original app.

Guess you like

Origin blog.csdn.net/pure81/article/details/124280290