TTS Workshop
Current location: Home > Workshops > TTS Workshop

AI Chatbot based on Mini-program of WeChat

Posted:2020-12-31 02:28:12 Click:2064

For the basic of a chatbot, the TTS (Text to Speech) is important for human-machine interaction. In this project, we choose Google Speech Recognition API as our back-end. In this part, you should know basic Python Programming to build environment for Google API working. After that, you should familiar with Mini-program for front-end, the last step is combine the API with Mini-program, so that we can use mini-program at our phone to communicate. For workshop evaluation, your phone must has the function that when you say something to the phone, it can appear the text in UI. Of course, if you want to further explore, you can try to connect a developed Chatbot to give response and get voice feedback.

1. Python Programming basic
2. Google Speech Recognition API test in local
3. Mini-program
4. Evaluation: Google API+ mini-program to interact with your phone


Part I
In the first part about Python Programming, I recommend Liao Xuefeng online course for you,
https://www.liaoxuefeng.com/wiki/1016959663602400


which including basic knowledge about python. Our target is that you should understand python code, demo, then modify the code following requirements.
Initially, if you want a completed environment, I strongly recommend you install Anaconda with jupyter notebook. Of course, you can choose different IDE with your preference.


Part II
Google Speech Recognition API
Notice. No need to register Google account
Reference link: How to build the environment for Google API response in local, you should keep your PC connect with Internet waiting for response.
https://pypi.org/project/SpeechRecognition/
In this link, which including demo of usage at your PC by Microphone.


Assignment:
Modify the code using Microphone to local voice file with wav format. I will provide mp3 file.
1. Transform the synthesize.mp3 to transcript.wav
2. Modify the code by demo
Notice. You may come across ffmpeg error with file cannot be found. Please install the multimedia file ffmpeg on your PC and add ENV Path. !!!Restart your PC.
Solution:
http://www.ffmpeg.org/download.html
https://blog.csdn.net/chy466071353/article/details/54949221
Attachment:
synthesize.mp3


Part III
Mini-program
How deeper you should learn? You must connect the python back-end with mini-program front-end. At your phone to use Google Speech Recognition API.
Reference link:
Official document:
https://developers.weixin.qq.com/miniprogram/dev/framework/
Bilibili video:
【WEB前端】零基础玩转微信小程序 https://www.bilibili.com/video/BV1nE41117BQ
实现小程序后台服务器https://www.bilibili.com/video/BV1pE411C7Ca

Part IV
Evaluation (Final test)
Combine Google API with Mini-program to get text response at WeChat UI.





到价提醒[关闭]