语音驱动程序  drv_voice.c

语音服务程序  srv_voice.c

1、先运行初始化函数,主要是设置初始音量,并建立一个软件定时器来,以10ms的周期来调用语音播放函数。

 1 void srvVoiceInit()
2 {
3 T_SOFT_TIMER_HANDLE hSoftTimer;
4 UINT16 usVoiceVolumeTunerAdjust;
5
6 g_hVoiceDevHandle = osalDevOpen(GEN20_PROTO_VOICE_DEV_NAME);
7 if (g_hVoiceDevHandle == INVALID_HANDLE)
8 {
9 LOG_ERROR_LOG(("srvVoiceInit failed at voice driver open.\r\n"));
10 }
11 else
12 {
13 /* Initialize voice play info structure, must before soft timer started. */
14 /* TODO: read default voice from EEPROM */
15 srvVoiSetDefaultVoiceType(VDVT_TYPE_A);
16 //g_tVoicePlayInfo.eSwitchStatus = VPSS_VOICE_IDLE;
17 gVoiPlayState = VPSS_VOICE_IDLE;
18 gVoiInnerEvent = E_NULL;
19 usVoiceVolumeTunerAdjust = 160;
20 //gVoiceToSet = 54;
21 srvSetVoiceVolume(63);
22 osalDevIoctl(g_hVoiceDevHandle, VOICE_CTRL_RST_PLAYBACK_CLR , NULL);
23 osalDevIoctl(g_hVoiceDevHandle, VOICE_CTRL_SET_VOICE_VOLUME, &usVoiceVolumeTunerAdjust);
24
25 /* Create the soft timer for push button service, the handle is not needed. */
26 if (OSAL_IS_RESULT_OK(osalTimCreateSoftTimer(&hSoftTimer, 10, STT_REPEAT, &srvVoicePlayTimerRoutine, NULL)))
27 {
28 if (OSAL_IS_RESULT_OK(osalTimStartSoftTimer(hSoftTimer)))
29 {
30 g_hVoiceMode = 0;
31 }
32 else
33 {
34 LOG_ERROR_LOG(("srvVoiceInit failed at SoftTimer start.\r\n"));
35 }
36 }
37 else
38 {
39 LOG_ERROR_LOG(("srvVoiceInit failed at SoftTimer create.\r\n"));
40 }
41 }
42 }

2 语音播放函数,先根据状态来设置语音模式,再根据模式来播放语音

 1 static void srvVoicePlayTimerRoutine(void *pvParam)
2 {
3 /* Wait event and return immediately. */
4 if(0 != g_hVoiceMode)
5 {
6 /* Some thing happened, adjust current voice play accordingly. */
7 srvVoiUpdateVoicePlayInfo(g_hVoiceMode);
8
9 /* Control voice play according to the information. */
10 srvVoiPlayVoice();
11 g_hVoiceMode = 0;
12 }
13 else
14 {
15 srvVoiPlayVoice();
16 }
17
18 }

3 更新语音播放信息,根据语音模式来更新

根据接收的语音事件来播放对应的语音片段,

语音包括以下

SRV_VOICE_PLAY_SYSTEM_START;系统启动声音

SRV_VOICE_PLAY_OPERATION_DENIED;操作禁止声音

SRV_VOICE_PLAY_TEST;测试声音

SRV_VOICE_PLAY_MIN_OUTPUT;小档位声音

SRV_VOICE_PLAY_MAX_OUTPUT;大档位声音

SRV_VOICE_PLAY_OVER_CURRENT;过流警报声

SRV_VOICE_PLAY_RECOVERABLE_FAULT;可恢复性错误声音

SRV_VOICE_PLAY_NON_RECOVERABLE_FAULT;不可恢复性错误

SRV_VOICE_PLAY_FAULT_REPLAY;错误重放

SRV_VOICE_PLAY_SHOW_DEFAULT_VOICE;默认语音

  1 static void srvVoiUpdateVoicePlayInfo(UINT uVoiceEvent)
2 {
3 if ((uVoiceEvent & SRV_VOICE_PLAY_SYSTEM_START) == SRV_VOICE_PLAY_SYSTEM_START)
4 {
5 /* Play welcome voice 1 time in fixed volume 60. */
6 gVoiInnerEvent = E_PLAY_VOICE;
7 g_tVoicePlayInfo.voiMode = VOI_MODE_REPEAT;
8 g_tVoicePlayInfo.wCurrVoiceSection = VOICE_SECTION_FLASH_START;
9 g_tVoicePlayInfo.usVoicePlayTimeIn10mS = VOICE_PLAY_DURATION_TIME_INFINITE;
10 g_tVoicePlayInfo.usVoicePlayRepeat = 1;
11 g_tVoicePlayInfo.usVoiceVolume = srvGetVoiceVolume();
12 //g_tVoicePlayInfo.usVoiceStopTimeoutIn10mS = 3;
13 g_tVoicePlayInfo.usVoiceStopIntervalTimeIn10mS = 10;
14 //g_tVoicePlayInfo.eSwitchStatus = VPSS_VOICE_START_PLAY;
15 }
16
17 if ((uVoiceEvent & SRV_VOICE_PLAY_OPERATION_DENIED) == SRV_VOICE_PLAY_OPERATION_DENIED)
18 {
19 /* Play welcome voice 1 time in fixed volume 60. */
20 gVoiInnerEvent = E_PLAY_VOICE;
21 g_tVoicePlayInfo.voiMode = VOI_MODE_REPEAT;
22 g_tVoicePlayInfo.wCurrVoiceSection = VOICE_SECTION_OPERATION_DENIED;
23 g_tVoicePlayInfo.usVoicePlayTimeIn10mS = VOICE_PLAY_DURATION_TIME_INFINITE;
24 g_tVoicePlayInfo.usVoicePlayRepeat = 1;
25 g_tVoicePlayInfo.usVoiceVolume = 60;
26 //g_tVoicePlayInfo.usVoiceStopTimeoutIn10mS = 3;
27 g_tVoicePlayInfo.usVoiceStopIntervalTimeIn10mS = 10;
28 //g_tVoicePlayInfo.eSwitchStatus = VPSS_VOICE_START_PLAY;
29 }
30 if ((uVoiceEvent & SRV_VOICE_PLAY_TEST) == SRV_VOICE_PLAY_TEST)
31 {
32 /* TODO: */
33 gVoiInnerEvent = E_PLAY_VOICE;
34 g_tVoicePlayInfo.voiMode = VOI_MODE_TIME_LIMITED;
35 g_tVoicePlayInfo.wCurrVoiceSection = VOICE_SECTION_TEST_IN_PROGRESS;
36 g_tVoicePlayInfo.usVoicePlayTimeIn10mS = VOICE_PLAY_DURATION_TIME_INFINITE;
37 g_tVoicePlayInfo.usVoicePlayRepeat = VOICE_PLAY_REPEAT_INFINITE;
38 g_tVoicePlayInfo.usVoiceVolume = srvGetVoiceVolume();
39 //g_tVoicePlayInfo.usVoiceStopTimeoutIn10mS = 3;
40 g_tVoicePlayInfo.usVoiceStopIntervalTimeIn10mS = 10;
41 //g_tVoicePlayInfo.eSwitchStatus = VPSS_VOICE_START_PLAY;
42 }
43 if ((uVoiceEvent & SRV_VOICE_PLAY_MIN_OUTPUT) == SRV_VOICE_PLAY_MIN_OUTPUT)
44 {
45 gVoiInnerEvent = E_PLAY_VOICE;
46 g_tVoicePlayInfo.voiMode = VOI_MODE_REPEAT;
47 g_tVoicePlayInfo.wCurrVoiceSection = g_tVoicePlayInfo.wVoiceDefaultMinOutput;
48 g_tVoicePlayInfo.usVoicePlayTimeIn10mS = VOICE_PLAY_DURATION_TIME_INFINITE;
49 g_tVoicePlayInfo.usVoicePlayRepeat = VOICE_PLAY_REPEAT_INFINITE;
50 g_tVoicePlayInfo.usVoiceVolume = srvGetVoiceVolume();// VOICE_PLAY_CURRENT_VOICE_VOLUME;
51 //g_tVoicePlayInfo.usVoiceStopTimeoutIn10mS = 3;
52 g_tVoicePlayInfo.usVoiceStopIntervalTimeIn10mS = 30; // last 26
53 //g_tVoicePlayInfo.eSwitchStatus = VPSS_VOICE_START_PLAY;
54 }
55 if ((uVoiceEvent & SRV_VOICE_PLAY_MAX_OUTPUT) == SRV_VOICE_PLAY_MAX_OUTPUT)
56 {
57 gVoiInnerEvent = E_PLAY_VOICE;
58 g_tVoicePlayInfo.voiMode = VOI_MODE_REPEAT;
59 g_tVoicePlayInfo.wCurrVoiceSection = g_tVoicePlayInfo.wVoiceDefaultMaxOutput;
60 g_tVoicePlayInfo.usVoicePlayTimeIn10mS = VOICE_PLAY_DURATION_TIME_INFINITE;
61 g_tVoicePlayInfo.usVoicePlayRepeat = VOICE_PLAY_REPEAT_INFINITE;
62 g_tVoicePlayInfo.usVoiceVolume = srvGetVoiceVolume(); //VOICE_PLAY_CURRENT_VOICE_VOLUME;
63 //g_tVoicePlayInfo.usVoiceStopTimeoutIn10mS = 3;
64 g_tVoicePlayInfo.usVoiceStopIntervalTimeIn10mS = 15; //last 10
65 //g_tVoicePlayInfo.eSwitchStatus = VPSS_VOICE_START_PLAY;
66 }
67 if ((uVoiceEvent & SRV_VOICE_PLAY_OVER_CURRENT) == SRV_VOICE_PLAY_OVER_CURRENT)
68 {
69 /* TODO: */
70 /* Play fatal error voice 1 time in fixed volume 60. */
71 gVoiInnerEvent = E_PLAY_VOICE;
72 g_tVoicePlayInfo.voiMode = VOI_MODE_REPEAT;
73 g_tVoicePlayInfo.wCurrVoiceSection = VOICE_SECTION_FATAL_ERROR;
74 g_tVoicePlayInfo.usVoicePlayTimeIn10mS = VOICE_PLAY_DURATION_TIME_INFINITE;
75 g_tVoicePlayInfo.usVoicePlayRepeat = 1;
76 g_tVoicePlayInfo.usVoiceVolume = 60;
77 //g_tVoicePlayInfo.usVoiceStopTimeoutIn10mS = 3;
78 g_tVoicePlayInfo.usVoiceStopIntervalTimeIn10mS = 10;
79 //g_tVoicePlayInfo.eSwitchStatus = VPSS_VOICE_START_PLAY;
80 }
81 if ((uVoiceEvent & SRV_VOICE_PLAY_RECOVERABLE_FAULT) == SRV_VOICE_PLAY_RECOVERABLE_FAULT)
82 {
83 /* Play fatal error voice 1 time in fixed volume 60. */
84 gVoiInnerEvent = E_PLAY_VOICE;
85 g_tVoicePlayInfo.voiMode = VOI_MODE_REPEAT;
86 g_tVoicePlayInfo.wCurrVoiceSection = VOICE_SECTION_FATAL_ERROR;
87 g_tVoicePlayInfo.usVoicePlayTimeIn10mS = VOICE_PLAY_DURATION_TIME_INFINITE;
88 g_tVoicePlayInfo.usVoicePlayRepeat = 1;//VOICE_PLAY_REPEAT_INFINITE;
89 g_tVoicePlayInfo.usVoiceVolume = 60;
90 //g_tVoicePlayInfo.usVoiceStopTimeoutIn10mS = 3;
91 g_tVoicePlayInfo.usVoiceStopIntervalTimeIn10mS = 10;
92 //g_tVoicePlayInfo.eSwitchStatus = VPSS_VOICE_START_PLAY;
93 }
94 if ((uVoiceEvent & SRV_VOICE_PLAY_NON_RECOVERABLE_FAULT) == SRV_VOICE_PLAY_NON_RECOVERABLE_FAULT)
95 {
96 /* Play fatal error voice 3 timeS in fixed volume 60. */
97 gVoiInnerEvent = E_PLAY_VOICE;
98 g_tVoicePlayInfo.voiMode = VOI_MODE_REPEAT;
99 g_tVoicePlayInfo.wCurrVoiceSection = VOICE_SECTION_FATAL_ERROR;
100 g_tVoicePlayInfo.usVoicePlayTimeIn10mS = VOICE_PLAY_DURATION_TIME_INFINITE;
101 g_tVoicePlayInfo.usVoicePlayRepeat = 1;//VOICE_PLAY_REPEAT_INFINITE;
102 g_tVoicePlayInfo.usVoiceVolume = 60;
103 //g_tVoicePlayInfo.usVoiceStopTimeoutIn10mS = 3;
104 g_tVoicePlayInfo.usVoiceStopIntervalTimeIn10mS = 10;
105 //g_tVoicePlayInfo.eSwitchStatus = VPSS_VOICE_START_PLAY;
106 }
107 if ((uVoiceEvent & SRV_VOICE_PLAY_FAULT_REPLAY) == SRV_VOICE_PLAY_FAULT_REPLAY)
108 {
109 /* Play fatal error voice 1 time in fixed volume 60. */
110 gVoiInnerEvent = E_PLAY_VOICE;
111 g_tVoicePlayInfo.voiMode = VOI_MODE_REPEAT;
112 g_tVoicePlayInfo.wCurrVoiceSection = VOICE_SECTION_FATAL_ERROR;
113 g_tVoicePlayInfo.usVoicePlayTimeIn10mS = VOICE_PLAY_DURATION_TIME_INFINITE;
114 g_tVoicePlayInfo.usVoicePlayRepeat = 1;
115 g_tVoicePlayInfo.usVoiceVolume = 60;
116 //g_tVoicePlayInfo.usVoiceStopTimeoutIn10mS = 3;
117 g_tVoicePlayInfo.usVoiceStopIntervalTimeIn10mS = 10;
118 //g_tVoicePlayInfo.eSwitchStatus = VPSS_VOICE_START_PLAY;
119 }
120 if ((uVoiceEvent & SRV_VOICE_PLAY_SHOW_DEFAULT_VOICE) == SRV_VOICE_PLAY_SHOW_DEFAULT_VOICE)
121 {
122 gVoiInnerEvent = E_PLAY_VOICE;
123 g_tVoicePlayInfo.voiMode = VOI_MODE_REPEAT;
124 g_tVoicePlayInfo.wCurrVoiceSection = VOICE_PLAY_DEFAULT_VOICE_SECTION;
125 g_tVoicePlayInfo.usVoicePlayTimeIn10mS = 100;
126 g_tVoicePlayInfo.usVoicePlayRepeat = VOICE_PLAY_REPEAT_INFINITE;
127 g_tVoicePlayInfo.usVoiceVolume = srvGetVoiceVolume();
128 g_tVoicePlayInfo.usVoiceStopIntervalTimeIn10mS = 10;
129 //g_tVoicePlayInfo.usVoiceStopTimeoutIn10mS = 3;
130 //g_tVoicePlayInfo.eSwitchStatus = VPSS_VOICE_START_PLAY;
131 }
132 if ((uVoiceEvent & SRV_VOICE_PLAY_STOP) == SRV_VOICE_PLAY_STOP)
133 {
134 /* Stop current play, don't change wCurrVoiceSection, left it done in srvVoiPlayVoice(). */
135 gVoiInnerEvent = E_STOP_VOICE ;
136 //g_tVoicePlayInfo.usVoiceStopTimeoutIn10mS = 3;
137 g_tVoicePlayInfo.usVoicePlayRepeat = 1;
138 g_tVoicePlayInfo.usVoiceVolume = 60; //
139 //g_tVoicePlayInfo.eSwitchStatus = VPSS_VOICE_EXPLICIT_STOP_PLAY;
140 }
141 }

4 语音信息结构体

 1 typedef struct{
2 VOI_MODE_TYPE voiMode;
3 UINT16 wCurrVoiceSection; /* 当前语音段. */
4 UINT16 usVoicePlayTimeIn10mS; /* 语音总时长. */
5 UINT16 usVoiceStopIntervalTimeIn10mS; /* 重复播放的间隔时间 */
6 UINT16 usVoiceStopIntervalRemainTimeIn10mS; /* 间隔时间的剩余量. */
7 //UINT16 usVoiceStopTimeoutIn10mS; /* Timeout when checking whether voice stopped. */
8 UINT16 usVoicePlayRepeat; /* 语音重复次数 */
9 UINT16 usVoiceVolume; /* 音量 */
10 UINT16 wVoiceDefaultMaxOutput;
11 UINT16 wVoiceDefaultMinOutput;
12 } T_VOICE_PLAY_INFO;

5 播放语音

static void srvVoiPlayVoice(void)
{
UINT16 wVoiceSection; //语音段
//UINT16 usVoiceVolumeTunerAdjust;
UINT16 usVoiceVolumeToSet; //设置的音量
UINT16 wVoiceStatus; //语音状态
T_OSAL_RESULT eRslt = OSAL_OK;
static UINT16 wLastVoiceStatus = 0; //上一次语音的状态
static UINT32 ticForwait;//等待的时钟数
static E_VOICE_PLAY_SWITCH_STATUS afterResetState = VPSS_VOICE_IDLE; if(gVoiPlayState != VPSS_VOICE_IDLE)
{ //语音状态非IDLE状态
if(gVoiInnerEvent == E_PLAY_VOICE)
{
gVoiPlayState = VPSS_VOICE_RESET;
afterResetState = VPSS_VOICE_LOAD_VOICE;
}else if(gVoiInnerEvent == E_STOP_VOICE){
gVoiPlayState = VPSS_VOICE_RESET;
afterResetState = VPSS_VOICE_IDLE;
}
} switch (gVoiPlayState)
{
case VPSS_VOICE_IDLE:
if(gVoiInnerEvent == E_PLAY_VOICE)
{
gVoiPlayState = VPSS_VOICE_LOAD_VOICE;
}
break; case VPSS_VOICE_LOAD_VOICE:
usVoiceVolumeToSet = g_tVoicePlayInfo.usVoiceVolume;
eRslt = osalDevIoctl(g_hVoiceDevHandle, VOICE_CTRL_SET_VOICE_VOLUME, &usVoiceVolumeToSet);//设置音量 if (OSAL_IS_RESULT_OK(eRslt))
{ //等音量设置完
wVoiceSection = g_tVoicePlayInfo.wCurrVoiceSection;
eRslt = osalDevWrite(g_hVoiceDevHandle, &wVoiceSection, 1); //加载待播放的语音 if (OSAL_IS_RESULT_OK(eRslt))
{ //等待语音加载完成
if(g_tVoicePlayInfo.voiMode == VOI_MODE_REPEAT)
{ //播放模式为重复播放模式
ticForwait = osalTimGetOSTime();
gVoiPlayState = VPSS_VOICE_TRIGGER_WAIT;
}
else if(g_tVoicePlayInfo.voiMode == VOI_MODE_TIME_LIMITED)
{ //限时播放模式
gVoiPlayState = VPSS_VOICE_PLAY_TIME_LIMITED;
}
}else{
LOG_ERROR_LOG(("Voice driver write failed. Error: %08x.\r\n", eRslt));
}
}else{
LOG_ERROR_LOG(("Voice driver ioctl failed. Error: %08x.\r\n", eRslt));
}
break; case VPSS_VOICE_TRIGGER_WAIT:
//wait 100ms
if((osalTimGetOSTime() -ticForwait) > 1000)
{
wVoiceSection = VOICE_SECTION_NULL;
eRslt = osalDevWrite(g_hVoiceDevHandle, &wVoiceSection, 1);
gVoiPlayState = VPSS_VOICE_PLAY_REPEAT;
}
break; case VPSS_VOICE_PLAY_REPEAT:
eRslt = osalDevIoctl(g_hVoiceDevHandle, VOICE_CTRL_READ_STATUS, &wVoiceStatus);
if (OSAL_IS_RESULT_OK(eRslt))
{
/* Check if current playing is finished */
if((wVoiceStatus == 0x0000) )//&(wLastVoiceStatus == 0x0001)
{
wLastVoiceStatus = 0;
g_tVoicePlayInfo.usVoiceStopIntervalRemainTimeIn10mS = g_tVoicePlayInfo.usVoiceStopIntervalTimeIn10mS;
gVoiPlayState = VPSS_VOICE_RELOAD_VOICE;
}else{
wLastVoiceStatus = wVoiceStatus;
}
}else{
LOG_ERROR_LOG(("Voice driver ioctl failed. Error: %08x.\r\n", eRslt));
}
break; case VPSS_VOICE_RELOAD_VOICE: if(g_tVoicePlayInfo.usVoiceStopIntervalRemainTimeIn10mS != 0)
{
g_tVoicePlayInfo.usVoiceStopIntervalRemainTimeIn10mS --;
}else{
if(g_tVoicePlayInfo.usVoicePlayRepeat != 0){
if(g_tVoicePlayInfo.usVoicePlayRepeat != VOICE_PLAY_REPEAT_INFINITE)
{
g_tVoicePlayInfo.usVoicePlayRepeat--;
}
if(g_tVoicePlayInfo.usVoicePlayRepeat != 0)
{
wVoiceSection = g_tVoicePlayInfo.wCurrVoiceSection;
eRslt = osalDevWrite(g_hVoiceDevHandle, &wVoiceSection, 1);
ticForwait = osalTimGetOSTime();
gVoiPlayState = VPSS_VOICE_TRIGGER_WAIT;
}
else{
gVoiPlayState = VPSS_VOICE_IDLE;
}
}else{
gVoiPlayState = VPSS_VOICE_IDLE;
}
}
break; case VPSS_VOICE_RESET:
wVoiceSection = VOICE_SECTION_NULL;
eRslt = osalDevWrite(g_hVoiceDevHandle, &wVoiceSection, 1);
eRslt = osalDevIoctl(g_hVoiceDevHandle, VOICE_CTRL_RST_PLAYBACK_SET, NULL);
ticForwait = osalTimGetOSTime();
gVoiPlayState = VPSS_VOICE_RESET_WAIT;
break; case VPSS_VOICE_RESET_WAIT:
if((osalTimGetOSTime() - ticForwait) > 500)
{
eRslt = osalDevIoctl(g_hVoiceDevHandle, VOICE_CTRL_RST_PLAYBACK_CLR , NULL);
gVoiPlayState = afterResetState;
}
break; case VPSS_VOICE_PLAY_TIME_LIMITED:
if(g_tVoicePlayInfo.usVoicePlayTimeIn10mS != VOICE_PLAY_DURATION_TIME_INFINITE )
{
if(g_tVoicePlayInfo.usVoicePlayTimeIn10mS != 0)
{
g_tVoicePlayInfo.usVoicePlayTimeIn10mS--;
}
else
{
gVoiPlayState = VPSS_VOICE_RESET;
afterResetState = VPSS_VOICE_IDLE;
}
}
break;
}
gVoiInnerEvent = E_NULL; }

基于DSP_CPLD_aP8942A_LM1791的语音控制的更多相关文章

  1. Diy智能家居-1.基于esp8266的语音控制系统(开篇)

    目录Diy智能家居-1.基于esp8266的语音控制系统(开篇) https://blog.csdn.net/arno1988/article/details/82628589 Diy智能家居-2.基 ...

  2. arduino 语音音箱 :语音控制、MP3播放、报时、回复温湿度情况

    arduino 语音音箱 :语音控制.MP3播放.报时.回复温湿度情况 效果图 线路图 包装后的效果 功能 需要材料 arduino板 MP3播放模块及喇叭 时钟模块 温湿度模块 语音识别模块 面包板 ...

  3. 基于MFCC的语音数据特征提取概述

    1. 概述 语音是人类之间沟通交流的最直接也是最快捷方便的一种手段,而实现人类与计算机之间畅通无阻的语音交流,一直是人类追求的一个梦想. 伴随着移动智能设备的普及,各家移动设备的厂家也开始在自家的设备 ...

  4. 智能家居-3.基于esp8266的语音控制系统(软件篇)

    智能家居-1.基于esp8266的语音控制系统(开篇) 智能家居-2.基于esp8266的语音控制系统(硬件篇) 智能家居-3.基于esp8266的语音控制系统(软件篇) 赞赏支持 QQ:505645 ...

  5. 智能家居-1.基于esp8266的语音控制系统(开篇)

    智能家居-1.基于esp8266的语音控制系统(开篇) 智能家居-2.基于esp8266的语音控制系统(硬件篇) 智能家居-3.基于esp8266的语音控制系统(软件篇) apache-apollo安 ...

  6. 基于MCRA-OMLSA的语音降噪(一):原理

    前面的几篇文章讲了webRTC中的语音降噪.最近又用到了基于MCRA-OMLSA的语音降噪,就学习了原理并且软件实现了它.MCRA主要用于噪声估计,OMLSA是基于估计出来的噪声去做降噪.类比于web ...

  7. 在iPhone上同时关闭语音控制和siri的方法

    分享 步骤及要点:1.在设置里打开siri.语音控制就自动关闭了.2.在siri里的"仅语言拨号"语言项里选择"土耳其文"或者"阿拉伯文". ...

  8. PocketSphinx语音识别和turtlebot的语音控制--18

    摘要: 原创博客:转载请表明出处:http://www.cnblogs.com/zxouxuewei/ 1.首先安装 PocketSphinx 语音识别: $ sudo apt--pocketsphi ...

  9. 在ASP.NET MVC中实现基于URL的权限控制

    本示例演示了在ASP.NET MVC中进行基于URL的权限控制,由于是基于URL进行控制的,所以只能精确到页.这种权限控制的优点是可以在已有的项目上改动极少的代码来增加权限控制功能,和项目本身的耦合度 ...

随机推荐

  1. Oracle数据常用的备份与恢复?

    Oracle的备份与恢复有三种标准的模式,大致分为两大类,备份恢复(物理上的)以及导入导出(逻辑上的),而备份恢复又可以根据数据库的工作模式分为非归档模式(Nonarchivelog-style)和归 ...

  2. Kafka 分区的目的?

    分区对于 Kafka 集群的好处是:实现负载均衡.分区对于消费者来说,可以提高并发度,提高效率.

  3. SpingMvc中的控制器的注解一般用那个,有没有别的注解可以替代?

    答:一般用@Controller注解,也可以使用@RestController,@RestController注解相当于@ResponseBody + @Controller,表示是表现层,除此之外, ...

  4. dos 循环读取当前文件夹下的视频名字

    @echo off for /R %%i in (*.mp4) do ( echo -isma %%~nxi ) pause

  5. ThreadLocal是什么?使用场景有哪些?

    什么是ThreadLocal? ThreadLocal为每个使用该变量的线程提供独立的变量副本,所以每一个线程都可以独立地改变自己的副本,而不会影响其它线程所对应的副本. 测试代码: package ...

  6. Netty学习摘记 —— 再谈引导

    本文参考 本篇文章是对<Netty In Action>一书第八章"引导"的学习摘记,主要内容为引导客户端和服务端.从channel内引导客户端.添加ChannelHa ...

  7. Flink调优

      第1章 资源配置调优 Flink性能调优的第一步,就是为任务分配合适的资源,在一定范围内,增加资源的分配与性能的提升是成正比的,实现了最优的资源配置后,在此基础上再考虑进行后面论述的性能调优策略. ...

  8. 模拟web服务器http请求应答

    我们在浏览器打开网页,其实是向远端服务器提出页面发送请求,远端服务器在接到请求后,就开始执行请求页面的程序文件,然后将执行结果通过html格式,发送到你的浏览器,再显示出来.以下用百度(www.bai ...

  9. 使用滑模控制对sin(t)曲线追踪

    结合:[Matlab]简单的滑模控制程序及Simulink仿真本片文章观看,此篇文章是在这篇文章的基础上进行修改的 输出u的推导过程 如果不明白控制量输出u的推到过成请看:[控制理论]滑模控制最强解析 ...

  10. 3_一起燃烧卡路里/科学减肥(1)_系统分析实例_数学建模部分_Matlab/Simulink