ASRPRO 记事本2
id号使用图 | |||
0-2465 | 时-分 | 1点5分-24点60 | 占用 |
3000-4231 | 月-日 | 1号-12月31号 | |
5000-5999 | 5000-5060 | 5分-十分,15。。。60 | |
5110 - 5340 | 一点--24点 | ||
5401-5420 | 一号-20号 | ||
5501-512 | 一月-12月 | ||
6000-6999 | 空 | ||
7000-7999 | |||
8000-8999 | 常用词 | 占用 | |
9000- | 空 | ||
10000- | |||
20000- | |||
39000 | 任务类ID | 占用 |
播放词ID
62500-62510 数字 年月日 | 占用 |
#include "asr.h"
extern "C"{ void * __dso_handle = 0 ;}
#include "setup.h"
#include "myLib/asr_event.h"
#include "HardwareSerial.h"uint32_t snid;
void ASR_CODE();//{speak:小蝶-清新女声,vol:10,speed:10,platform:haohaodada}
//{playid:10001,voice:你好,我是您的智能语音助手,请用天问五幺唤醒我}
//{playid:10002,voice:我休息了,用天问五幺唤醒我}/*
id号使用图
0-2465 时-分 1点5分-24点60 占用
3000-4231 年-月 1号-12月31号
5000-5999 5000-5060 5分-十分,15。。。605110 - 5340 一点--24点5401-5420 一号-20号5501-512 一月-12月
6000-6999 空
7000-7999
8000-8999 常用词 占用
9000- 空
10000-
2000-
3000-
*/int num = 0;
//{ID:5401,keyword:"命令词",ASR:"一号",ASRTO:" "}
//{ID:5402,keyword:"命令词",ASR:"二号",ASRTO:" "}
//{ID:5403,keyword:"命令词",ASR:"三号",ASRTO:" "}
//{ID:5404,keyword:"命令词",ASR:"四号",ASRTO:" "}
//{ID:5405,keyword:"命令词",ASR:"五号",ASRTO:" "}
//{ID:5406,keyword:"命令词",ASR:"六号",ASRTO:" "}
//{ID:5407,keyword:"命令词",ASR:"七号",ASRTO:" "}
//{ID:5408,keyword:"命令词",ASR:"八号",ASRTO:" "}
//{ID:5409,keyword:"命令词",ASR:"九号",ASRTO:" "}
//{ID:5410,keyword:"命令词",ASR:"十号",ASRTO:" "}
//{ID:5420,keyword:"命令词",ASR:"二十号",ASRTO:" "}//{ID:5501,keyword:"命令词",ASR:"一月",ASRTO:" "}
//{ID:5502,keyword:"命令词",ASR:"二月",ASRTO:" "}
//{ID:5503,keyword:"命令词",ASR:"三月",ASRTO:" "}
//{ID:5504,keyword:"命令词",ASR:"四月",ASRTO:" "}
//{ID:5505,keyword:"命令词",ASR:"五月",ASRTO:" "}
//{ID:5506,keyword:"命令词",ASR:"六月",ASRTO:" "}
//{ID:5507,keyword:"命令词",ASR:"七月",ASRTO:" "}
//{ID:5508,keyword:"命令词",ASR:"八月",ASRTO:" "}
//{ID:5509,keyword:"命令词",ASR:"九月",ASRTO:" "}
//{ID:5510,keyword:"命令词",ASR:"十月",ASRTO:" "}
//{ID:5511,keyword:"命令词",ASR:"十一月",ASRTO:" "}
//{ID:5512,keyword:"命令词",ASR:"十二月",ASRTO:" "}//{ID:5005,keyword:"命令词",ASR:"五分",ASRTO:" "}
//{ID:5010,keyword:"命令词",ASR:"十分",ASRTO:" "}
//{ID:5015,keyword:"命令词",ASR:"十五",ASRTO:" "}
//{ID:5020,keyword:"命令词",ASR:"二十",ASRTO:" "}
//{ID:5025,keyword:"命令词",ASR:"二十五",ASRTO:" "}
//{ID:5030,keyword:"命令词",ASR:"三十",ASRTO:" "}
//{ID:5035,keyword:"命令词",ASR:"三十五",ASRTO:" "}
//{ID:5040,keyword:"命令词",ASR:"四十",ASRTO:" "}//{ID:2305,keyword:"命令词",ASR:"二十三点五分",ASRTO:" "}
//{ID:2310,keyword:"命令词",ASR:"二十三点十分",ASRTO:" "}
//{ID:2315,keyword:"命令词",ASR:"二十三点十五",ASRTO:" "}
//{ID:2320,keyword:"命令词",ASR:"二十三点二十",ASRTO:" "}
//{ID:2325,keyword:"命令词",ASR:"二十三点二十五",ASRTO:" "}
//{ID:2330,keyword:"命令词",ASR:"二十三点三十",ASRTO:" "}
//{ID:2335,keyword:"命令词",ASR:"二十三点三十五",ASRTO:" "}
//{ID:2340,keyword:"命令词",ASR:"二十三点四十",ASRTO:" "}
//{ID:2345,keyword:"命令词",ASR:"二十三点四十五",ASRTO:" "}
//{ID:2350,keyword:"命令词",ASR:"二十三点五十",ASRTO:" "}
//{ID:2355,keyword:"命令词",ASR:"二十三点五十五",ASRTO:" "}
//{ID:2360,keyword:"命令词",ASR:"二十三点六十",ASRTO:" "}//{ID:2405,keyword:"命令词",ASR:"二十四点五分",ASRTO:" "}
//{ID:2410,keyword:"命令词",ASR:"二十四点十分",ASRTO:" "}
//{ID:2415,keyword:"命令词",ASR:"二十四点十五",ASRTO:" "}
//{ID:2420,keyword:"命令词",ASR:"二十四点二十",ASRTO:" "}
//{ID:2425,keyword:"命令词",ASR:"二十四点二十五",ASRTO:" "}
//{ID:2430,keyword:"命令词",ASR:"二十四点三十",ASRTO:" "}
//{ID:2435,keyword:"命令词",ASR:"二十四点三十五",ASRTO:" "}
//{ID:2440,keyword:"命令词",ASR:"二十四点四十",ASRTO:" "}
//{ID:2445,keyword:"命令词",ASR:"二十四点四十五",ASRTO:" "}
//{ID:2450,keyword:"命令词",ASR:"二十四点五十",ASRTO:" "}
//{ID:2455,keyword:"命令词",ASR:"二十四点五十五",ASRTO:" "}
//{ID:2460,keyword:"命令词",ASR:"二十四点六十",ASRTO:" "}
//{ID:2465,keyword:"命令词",ASR:"二十四点六十五",ASRTO:" "}//播报单 ID
//{playid:62500,voice:零}
//{playid:62501,voice:一}
//{playid:62502,voice:二}
//{playid:62503,voice:三}
//{playid:62504,voice:四}
//{playid:62505,voice:五}
//{playid:62506,voice:六}
//{playid:62507,voice:七}
//{playid:62508,voice:八}
//{playid:62509,voice:九}
//{playid:62510,voice:十}
//{playid:62511,voice:百}
//{playid:10012,voice:千}
//{playid:62513,voice:分}
//{playid:62514,voice:钟}
//{playid:62515,voice:点}
//{playid:62516,voice:年}
//{playid:62517,voice:月}
//{playid:62518,voice:周}
//{playid:62519,voice:日}
//{playid:62520,voice:号}
/*
//常用词 0xxxx//{ID:9011,keyword:"命令词",ASR:"十分钟后叫我一下",ASRTO:" "}
//{ID:9021,keyword:"命令词",ASR:"二十分钟后叫我一下",ASRTO:" "}
//{ID:9031,keyword:"命令词",ASR:"三十分钟后叫我一下",ASRTO:" "}
//{ID:9041,keyword:"命令词",ASR:"四十分钟后叫我一下",ASRTO:" "}
//{ID:9001,keyword:"命令词",ASR:"倒计时一分钟",ASRTO:" "}
//{ID:9012,keyword:"命令词",ASR:"倒计时十分钟",ASRTO:" "}
//{ID:9022,keyword:"命令词",ASR:"倒计时二十分钟",ASRTO:" "}
//{ID:9032,keyword:"命令词",ASR:"倒计时三十分钟",ASRTO:" "}
//{ID:9061,keyword:"命令词",ASR:"倒计时一小时",ASRTO:" "}
//{ID:9120,keyword:"命令词",ASR:"两个小时后叫我一下",ASRTO:" "}
//{ID:9062,keyword:"命令词",ASR:"一小时后叫我一下",ASRTO:" "}
//{ID:9501,keyword:"命令词",ASR:"五点叫我一下",ASRTO:" "}//{ID:60001,keyword:"命令词",ASR:"叫我一下",ASRTO:" "}
//{ID:60002,keyword:"命令词",ASR:"告诉叫我一下",ASRTO:" "}
//{ID:60003,keyword:"命令词",ASR:"提醒我一下",ASRTO:" "}
//{ID:60004,keyword:"命令词",ASR:"瓦力伊娃在哪里",ASRTO:" "}
*/
struct time2 //任务结构 时间 -任务
{
//char year; char month;char day;char hour;char minite;};
struct project
{
char status; //0停止 //1运行 //2
char freq; //1每天 2每星期 3每月 4每年char ymw[4];
/*
char year;
char month;
char week;
char day;*/char tm[2]; //时分秒
int event; //事件
};
project ts[50];void numVoice(int num) //播放数字
{
int n1 = num%10;
int n2 = num%100 -n1;
if(n2 !=0){
play_audio(62500+n2/10); //X
play_audio(62510);} //十
if(n1 !=0)
play_audio(62500+n1); //X
}void numbVoice(int numb) //播放号码 2014
{
char c[10] ;
itoa(numb,c,10);
char l = strlen(c);for(int i=0;i<l;i++){
play_audio(62500+(c[i]-'0')); //X
Serial.print(62500+(c[i]-'0'));
}
}void TimeVoice2(project ts)
{if(ts.ymw[3] != 0)
{
numbVoice(ts.ymw[3]);
play_audio(62516); //year
}
if(ts.ymw[2] != 0)
{
numVoice(ts.ymw[2]);
play_audio(62517); //month
}
if(ts.ymw[1] != 0)
{
numVoice(ts.ymw[1]);
play_audio(62518); //week
}
if(ts.ymw[0] != 0)
{
numVoice(ts.ymw[0]);
play_audio(62519); //day
}if(ts.tm[1] !=0)
{
numVoice(ts.tm[1]);
Serial.print("hour:");
Serial.println(ts.tm[1],DEC);play_audio(62515); //hour
}
if(ts.tm[0] !=0)
{
numVoice(ts.tm[0]);
Serial.print("min:");
Serial.println(ts.tm[0],DEC);
play_audio(62513); //min
}}
void TimeVoice(int num) //播放时间 二十四时30分
{int n1 = num%10;
int n2 = num%100-n1;if(n2 !=0){
numVoice(n2);
play_audio(62513);
play_audio(62514); } //时
if(n1 !=0){
numVoice(n1);
play_audio(62513);} //分
}//play_audio(42); //任务已记录
//TimeVoice(_snid); //播放时间//播报 任务确认 2024年5月20号早上9点 开会/*描述该功能...
*/
void ASR_CODE(){Serial.println(snid);int _sid = snid/10000;if(snid <6000){if(snid <3000) //时分{ts[num].tm[1] = char(snid /100);ts[num].tm[0] = snid %100;}else if(snid<5000) //月 日{ts[num].ymw[2] = char((snid-3000) /100); //monthts[num].ymw[0] = snid %100; //day}else{ //正点if(snid <= 5060){ //mints[num].tm[0] = char(snid-5000);}else if(snid <= 5340){ //1点-24点ts[num].tm[1] = snid%100;}else if(snid <= 5420){ //1号 -20号ts[num].ymw[0] = snid %100;}else if(snid <= 5512){ //1月-24月ts[num].ymw[2] = snid %100;}}}else{//结束词}char c[20];sprintf(c,"%d-%d-%d %d:%d",ts[num].ymw[3],ts[num].ymw[2],ts[num].ymw[0],ts[num].tm[1],ts[num].tm[0]);Serial.println(c);}//{ID:8001,keyword:"命令词",ASR:"倒计时一分钟",ASRTO:" "}
//{ID:8011,keyword:"命令词",ASR:"倒计时十分钟",ASRTO:" "}
//{ID:8022,keyword:"命令词",ASR:"倒计时二十分钟",ASRTO:" "}
//{ID:8031,keyword:"命令词",ASR:"倒计时三十分钟",ASRTO:" "}
//{ID:8061,keyword:"命令词",ASR:"倒计时一小时",ASRTO:" "}//{ID:8010,keyword:"命令词",ASR:"十分钟后",ASRTO:" "}
//{ID:8020,keyword:"命令词",ASR:"二十分钟后",ASRTO:" "}
//{ID:8030,keyword:"命令词",ASR:"三十分钟后",ASRTO:" "}
//{ID:8040,keyword:"命令词",ASR:"四十分钟后",ASRTO:" "}
//{ID:8120,keyword:"命令词",ASR:"两个小时后",ASRTO:" "}
//{ID:8060,keyword:"命令词",ASR:"一小时后",ASRTO:" "}//{ID:8100,keyword:"命令词",ASR:"明天早上",ASRTO:" "}
//{ID:8101,keyword:"命令词",ASR:"明天下午",ASRTO:" "}
//{ID:8102,keyword:"命令词",ASR:"明天晚上",ASRTO:" "}//{ID:8200,keyword:"命令词",ASR:"后天早上",ASRTO:" "}
//{ID:8201,keyword:"命令词",ASR:"后天下午",ASRTO:" "}
//{ID:8202,keyword:"命令词",ASR:"后天晚上",ASRTO:" "}//{ID:8301,keyword:"命令词",ASR:"周一",ASRTO:" "}
//{ID:8302,keyword:"命令词",ASR:"周二",ASRTO:" "}
//{ID:8303,keyword:"命令词",ASR:"周三",ASRTO:" "}
//{ID:8304,keyword:"命令词",ASR:"周四",ASRTO:" "}
//{ID:8305,keyword:"命令词",ASR:"周五",ASRTO:" "}
//{ID:8306,keyword:"命令词",ASR:"周六",ASRTO:" "}
//{ID:8307,keyword:"命令词",ASR:"周末",ASRTO:" "}
//{ID:8308,keyword:"命令词",ASR:"周日",ASRTO:" "}//{ID:8401,keyword:"命令词",ASR:"下周一",ASRTO:" "}
//{ID:8402,keyword:"命令词",ASR:"下周二",ASRTO:" "}
//{ID:8403,keyword:"命令词",ASR:"下周三",ASRTO:" "}
//{ID:8404,keyword:"命令词",ASR:"下周四",ASRTO:" "}
//{ID:28405,keyword:"命令词",ASR:"下周五",ASRTO:" "}
//{ID:8406,keyword:"命令词",ASR:"下周六",ASRTO:" "}
//{ID:8407,keyword:"命令词",ASR:"下周日",ASRTO:" "}//{ID:8508,keyword:"命令词",ASR:"每天",ASRTO:" "}
//{ID:8501,keyword:"命令词",ASR:"每周一",ASRTO:" "}
//{ID:8502,keyword:"命令词",ASR:"每周二",ASRTO:" "}
//{ID:8503,keyword:"命令词",ASR:"每周三",ASRTO:" "}
//{ID:8504,keyword:"命令词",ASR:"每周四",ASRTO:" "}
//{ID:8505,keyword:"命令词",ASR:"每周五",ASRTO:" "}
//{ID:8506,keyword:"命令词",ASR:"每周六",ASRTO:" "}
//{ID:8507,keyword:"命令词",ASR:"每周末",ASRTO:" "}//{ID:8509,keyword:"命令词",ASR:"每月",ASRTO:" "}
//{ID:8510,keyword:"命令词",ASR:"每年",ASRTO:" "}void hardware_init(){vol_set(1);vTaskDelete(NULL);
}void setup()
{//{ID:0,keyword:"唤醒词",ASR:"天问五幺",ASRTO:"我在"}//{ID:1,keyword:"命令词",ASR:"今天天气",ASRTO:"杭州今天晴,空气良好,适合出去走走"}//{ID:9999,keyword:"命令词",ASR:"你几岁了",ASRTO:"我今年已经五岁了"}//{ID:3,keyword:"命令词",ASR:"你会做什么",ASRTO:"我可以陪你聊天哦"}//{ID:4,keyword:"命令词",ASR:"给我讲个笑话吧",ASRTO:"以前有一个人在睡觉,然后一只蚊子过来咬他了。他被叮醒正准备一只手啪下去的时候,蚊子对他说,求求你别杀我,今天是我的生日。那个人听说后,小心翼翼把蚊子放在手心,一边拍手一边唱生日快乐歌!"}setPinFun(13,SECOND_FUNCTION);setPinFun(14,SECOND_FUNCTION);Serial.begin(9600);
}
将用户 i'd号与任务 联系起来 提供外部接口 任务条件达成 执行指定任务
规划 39000- 任务区 识别为任务 可执行 程序
默认 播报
默认 内部定时器 时钟源 ; 串口 获 外部时间比对