完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
前期对开发板进行了一轮的熟悉过程, 今天来给大家分享一下一款智能语音门锁 首先可以自己录制mp3文件 我自己用小程序制作了2段开锁,解锁提示音 把提示音放入projectappsrcaudiolfsdisklfs文件夹下 再双击projectappsrcaudiolfsdisk文件夹下的lfsdisk-x86.exe 自动生成一个lfs.bin 把这个文件替换projectappsrcaudio文件下的bin 然后就是修改AUDIO_RES.h文件 代码如下 主要是添加语音的路径 #ifndef _AUDIO_RES_H_ #define _AUDIO_RES_H_ #define LOCAL_AUDIO_NET_CFG_CONFIG_PATH "/lfs/net_cfg_config.mp3" #define LOCAL_AUDIO_NET_CFG_CONN_PATH "/lfs/net_cfg_conn.mp3" #define LOCAL_AUDIO_NET_CFG_FAIL_PATH "/lfs/net_cfg_fail.mp3" #define LOCAL_AUDIO_NET_CFG_START_PATH "/lfs/net_cfg_start.mp3" #define LOCAL_AUDIO_NET_CFG_SWITCH_PATH "/lfs/net_cfg_switch.mp3" #define LOCAL_AUDIO_NET_CFG_tiMEOUT_PATH "/lfs/net_cfg_timeout.mp3" #define LOCAL_AUDIO_NET_FAIL_PATH "/lfs/net_fail.mp3" #define LOCAL_AUDIO_NET_SUCC_PATH "/lfs/net_succ.mp3" #define LOCAL_AUDIO_OK_PATH "/lfs/ok.mp3" #define LOCAL_AUDIO_PLAY_ERR_PATH "/lfs/play_err.mp3" #define LOCAL_AUDIO_SORRY_PATH "/lfs/sorry.mp3" #define LOCAL_AUDIO_SORRY2_PATH "/lfs/sorry2.mp3" #define LOCAL_AUDIO_STARTING_PATH "/lfs/starting.mp3" #define LOCAL_AUDIO_LOCK_PATH "/lfs/lock.mp3" #define LOCAL_AUDIO_NOLOCK_PATH "/lfs/nolock.mp3" #define LOCAL_AUDIO_WAKEUP_COMING_PATH "/lfs/wakeup_coming.mp3" #define LOCAL_AUDIO_WAKEUP_GO_AHEAD_PATH "/lfs/wakeup_go_ahead.mp3" #define LOCAL_AUDIO_WAKEUP_HELLO_PATH "/lfs/wakeup_hello.wav" #define LOCAL_AUDIO_WAKEUP_HI_PATH "/lfs/wakeup_hi.mp3" #define LOCAL_AUDIO_WAKEUP_IM_HERE_PATH "/lfs/wakeup_im_here.mp3" typedef enum { LOCAL_AUDIO_NET_CFG_CONFIG, LOCAL_AUDIO_NET_CFG_CONN, LOCAL_AUDIO_NET_CFG_FAIL, LOCAL_AUDIO_NET_CFG_START, LOCAL_AUDIO_NET_CFG_SWITCH, LOCAL_AUDIO_NET_CFG_TIMEOUT, LOCAL_AUDIO_NET_FAIL, LOCAL_AUDIO_NET_SUCC, LOCAL_AUDIO_OK, LOCAL_AUDIO_PLAY_ERR, LOCAL_AUDIO_SORRY, LOCAL_AUDIO_SORRY2, LOCAL_AUDIO_STARTING, LOCAL_AUDIO_LOCK, LOCAL_AUDIO_NOLOCK, LOCAL_AUDIO_END } local_audio_name_t; typedef enum { LOCAL_AUDIO_WAKEUP_COMING, LOCAL_AUDIO_WAKEUP_GO_AHEAD, LOCAL_AUDIO_WAKEUP_HELLO, LOCAL_AUDIO_WAKEUP_HI, LOCAL_AUDIO_WAKEUP_IM_HERE, LOCAL_AUDIO_WAKEUP_END } local_wakeup_audio_name_t; #define AUDIO_RES_ARRAY {LOCAL_AUDIO_NET_CFG_CONFIG_PATH}, {LOCAL_AUDIO_NET_CFG_CONN_PATH}, {LOCAL_AUDIO_NET_CFG_FAIL_PATH}, {LOCAL_AUDIO_NET_CFG_START_PATH}, {LOCAL_AUDIO_NET_CFG_SWITCH_PATH}, {LOCAL_AUDIO_NET_CFG_TIMEOUT_PATH}, {LOCAL_AUDIO_NET_FAIL_PATH}, {LOCAL_AUDIO_NET_SUCC_PATH}, {LOCAL_AUDIO_OK_PATH}, {LOCAL_AUDIO_PLAY_ERR_PATH}, {LOCAL_AUDIO_SORRY_PATH}, {LOCAL_AUDIO_SORRY2_PATH}, {LOCAL_AUDIO_STARTING_PATH}, {LOCAL_AUDIO_LOCK_PATH}, {LOCAL_AUDIO_NOLOCK_PATH}, {NULL} #define AUDIO_WAKEUP_RES_ARRAY {LOCAL_AUDIO_WAKEUP_COMING_PATH}, {LOCAL_AUDIO_WAKEUP_GO_AHEAD_PATH}, {LOCAL_AUDIO_WAKEUP_HELLO_PATH}, {LOCAL_AUDIO_WAKEUP_HI_PATH}, {LOCAL_AUDIO_WAKEUP_IM_HERE_PATH}, {NULL} int local_audio_play(local_audio_name_t name); int local_wakeup_audio_play(local_wakeup_audio_name_t name); void local_audio_finish_check(); #endif 最后附加成品视频 文章转载自:平头哥芯片开放社区 作者:marchmaqi |
|
相关推荐
|
|
只有小组成员才能发言,加入小组>>
【平头哥Sipeed LicheeRV 86开发板试用体验】Waft初体验
15659 浏览 1 评论
13707 浏览 4 评论
【平头哥Sipeed LicheeRV 86开发板试用体验】四、烧写waft系统&搭建waft测试环境
19624 浏览 2 评论
59031 浏览 19 评论
【限时福利】加入芯片开发社区,领100G电子工程师资料大礼包
87731 浏览 121 评论
邀请函 | 3月2日 来上海参加平头哥“玄铁RISC-V生态大会”
743浏览 0评论
读书分享会 | 玄铁RISC-V处理器入门与实战电子书免费下载!
637浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-24 22:19 , Processed in 0.601722 second(s), Total 69, Slave 52 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号