语音驱动程序  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. Spring Boot 中的监视器是什么?

    Spring boot actuator 是 spring 启动框架中的重要功能之一.Spring boot 监视器可帮助您访问生产环境中正在运行的应用程序的当前状态.有几个指标必须在生产环境中进行检 ...

  2. Filter是什么?有什么作用?

    Filter是过滤器,在请求到达Servlet之前或者响应到达客户端之前截获请求或者响应,对之进行相应的处理.Struts2的控制器就是使用一个Filter实现的.

  3. keybd_event 在F按键系列不起作用的解决办法

    最近给公司做自动化测试工具,主要用到的功能是模拟鼠标键盘录制回放.一切都很完美了,但在客户大机系统上使用的时候,发现F1-F24系列按键无法正确使用,查了很多资料,主要有2个方面的原因: 1.一些游戏 ...

  4. 如果有大量的 key 需要设置同一时间过期,一般需要注意什么?

    如果大量的 key 过期时间设置的过于集中,到过期的那个时间点,redis 可能 会出现短暂的卡顿现象.一般需要在时间上加一个随机值,使得过期时间分散一 些.

  5. Spring IoC 的实现机制?

    Spring 中的 IoC 的实现原理就是工厂模式加反射机制. 示例: interface Fruit { public abstract void eat(); } class Apple impl ...

  6. Spring常用的注入方式有哪些?

    Spring通过DI(依赖注入)实现IOC(控制反转),常用的注入方式主要有三种:构造方法注入,setter注入,基于注解的注入. 参考链接:Spring常用的三种注入方式

  7. 什么是 Spring MVC 框架的控制器?

    控制器提供一个访问应用程序的行为,此行为通常通过服务接口实现.控制器解 析用户输入并将其转换为一个由视图呈现给用户的模型.Spring 用一个非常抽象 的方式实现了一个控制层,允许用户创建多种用途的控 ...

  8. Flask 简单使用,这一篇就够了!

    #Flask 安装依赖包及作用 - jinja2 模板语言 (flask依赖包) - markupsafe 防止css攻击 (flask依赖包) - werkzeug --wkz 类似于django中 ...

  9. Effective Java —— try-with-resources 优先于 try-finally

    本文参考 本篇文章参考自<Effective Java>第三版第九条"Prefer try-with-resources to try-finally" The cod ...

  10. ubuntu vmware kernel module updater

    Ubuntu 19.04 - VMWare内核模块更新程序问问题 4 3我运行了这个命令: apt-cache search linux-headers-$(uname -r)它返回输出 linux- ...