# Voice-operated snake game
This application is an implement of off-line spoken keyword spotting using MLI Lib based on ARC IoT Development Kit.The optimized convolutional neural network can figure out ten basic control commands,even though the processing unit is not that powerful.Then we can use voice to control many things,for example,a snake game.
DEMO VIDEO:[Video presentation](https://v.youku.com/v_show/id_XNDI5MDI2NjE2NA==.html?spm=a2h3j.8428770.3416059.1)
* [Introduction](#introduction)
* [Function](#function)
* [System Architecture](#system-architecture)
* [Hardware and Software Setup](#hardware-and-software-setup)
* [Required Hardware](#required-hardware)
* [Required Software](#required-software)
* [Hardware Connection](#hardware-connection)
* [User Manual](#user-manual)
* [Before Running This Application](#before-running-this-application)
* [Run This Application](#run-this-application)
## Introduction
### Function
- Spotting the ten spoken commands:yes/no/up/down/left/right/on/off/stop/go.And the word will be printed through uart.
- Play the game!Saying up/down/left/right commands,you can change the direction of the snake to catch the food or avoid crash with itself.
### System Architecture
![system_architecture][0]
## Hardware and Software Setup
### Required Hardware
- ARC IoT Development Kit
![ARC IoT Development Kit][1]
- WM8978 CODEC module
![WM8978 CODEC module][2]
- LED Matrix(MAX7219)
![LED Matrix][3]
### Required Software
- ARC GNU Toolset 2018.09
- emcARC OSP 2018.12 with MLI Lib
- Serial port terminal, such as putty, tera-term or minicom
### Hardware Connection
1.MAX7219 pins.
|MAX7219 pins|IoT DK pins |
|------------|-------------|
|CS |GPIO_8b0_PIN4|
|DATA |GPIO_8b0_PIN5|
|CLK |GPIO_8b1_PIN4|
2.Connect I2C pins of WM8978 to I2C0 of IoT DK.
3.Connect I2S pins of WM8978 to I2S_RX of IoT DK.**The REF_CLK should not be connected untile the initialization of WM8978 is finished**.
## User Manual
### Before Running This Application
- Download source code of SoundSnake from github.
- Make sure all the connections are correct.
- The link script file has been modified to ensure the heap and stack are large enough and the addresses of program sections have also been redirected.Make sure the link script is correct.
### Run This Application
- Open serial terminal and configure it to right COM port and 115200bps.
- Download with USB-JTAG or use bootloader to boot the program.
- Connect the MCLK(REF_CLK) wire when seeing "Please connet the mclk !"at serial terminal.
- Speak to the Mic.You'll see the word at the serial terminal and the snake will follow your command to change direction.
#### Makefile
- Selected MLI Lib here, then you can use MLI Lib API in your application:
LIB_SEL = embarc_mli
- Target options about IoT DK and toolchain:
BOARD = iotdk
BD_VER = 10
TOOLCHAIN = gnu
- The middleware used in your application:
MID_SEL = common
See [ embARC Example User Guide][40], **"Options to Hard-Code in the Application Makefile"** for more detailed information about **Makefile Options**.
#### Flie structure
| file | Function |
| ------------------- | -----------------------------------------|
| main.c | Initialization and main loop |
| kws.c/kws.h | Keyword spotting(CNN) |
| ds_cnn_weights.h | Weights list of CNN |
| mfcc.c/mfcc.h | Algorithm of extracting mfcc features |
| codec.c/codec.h | Recive and store audio frames(interrupt)| | snake.c/snake.h | Snake game and LED Matrix driver |
| FFT.c/FFT.h | Fast Fourier transform |
| wm8978.c/wm8978.h | Config wm8978 through I2C |
| wm8978i2s.c/.h | I2S driver |
[0]: ./images/System_Architecture.PNG "system_architecture"
[1]: ./images/ARC_IoT_Development_Kit.jpg "ARC IoT Development Kit"
[2]: ./images/WM8978_CODEC_module.jpg "WM8978 CODEC module"
[3]: ./images/LED_Matrix(MAX7219).jpg "LED Matrix"
[40]: http://embarc.org/embarc_osp/doc/embARC_Document/html/page_example.html " embARC Example User Guide"
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
SoundSnake:基于Synopsys_Iot_DK_的离线语音交互系统,“华为杯”第二届中国研_SoundSnake.rar (25个子文件)
SoundSnake-master
.gitattributes 66B
src
makefile 530B
ds_cnn_weights.h 72KB
mfcc.h 1KB
wm8978.c 12KB
mfcc.c 7KB
snake.h 645B
FFT.h 132B
kws.h 3KB
codec.h 136B
wm8978.h 4KB
obj_iotdk_10
gnu_arcem9d
linker_gnu.ldf 4KB
codec.c 2KB
FFT.c 4KB
snake.c 6KB
wm8978i2s.h 4KB
wm8978i2s.c 9KB
main.c 2KB
kws.c 9KB
appl_mem_config.h 1KB
images
ARC_IoT_Development_Kit.jpg 62KB
System_Architecture.PNG 84KB
LED_Matrix(MAX7219).jpg 70KB
WM8978_CODEC_module.jpg 40KB
README.md 4KB
共 25 条
- 1
资源评论
2401_87496566
- 粉丝: 1085
- 资源: 5284
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功