Skip to content

Commit e9358ac

Browse files
ParkerIRISZZW
authored andcommitted
NCKU_Assistant_MacTavish
1 parent 83e90ad commit e9358ac

36 files changed

+5531
-0
lines changed
153 KB
Binary file not shown.

arc_design_contest/2020/NCKU_AssistantMacTavish/CYBase.mod.h

Lines changed: 3269 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
2+
#ifndef __DSPOTTERSDK_API_H
3+
#define __DSPOTTERSDK_API_H
4+
5+
#if defined(_WIN32)
6+
#ifdef DSpotterDll_EXPORTS
7+
#define DSPDLL_API __declspec(dllexport)
8+
#endif
9+
#endif
10+
11+
#ifndef DSPDLL_API
12+
#define DSPDLL_API
13+
#endif
14+
15+
#include "base_types.h"
16+
#include "DSpotterSDKApi_Const.h"
17+
18+
#ifdef __cplusplus
19+
extern "C"{
20+
#endif
21+
22+
// lpbyCYBase(IN): The background model, contents of CYBase.mod.
23+
// lppbyModel(IN): The command model.
24+
// nMaxTime(IN): The maximum buffer length in number of frames for keeping the status of commands.
25+
// lpbyMemPool(IN/OUT): Memory buffer for the recognizer.
26+
// nMemSize(IN): Size in bytes of the memory buffer lpbyMemPool.
27+
// lpbyPreserve(IN/OUT): Preserve param.
28+
// nPreserve(IN): Preserve param.
29+
// pnErr(OUT): DSPOTTER_SUCCESS indicates success, else error code. It can be NULL.
30+
// Return: a recognizer handle or NULL
31+
DSPDLL_API HANDLE DSpotter_Init_Multi(BYTE *lpbyCYBase, BYTE *lppbyModel[], INT nNumModel, INT nMaxTime, BYTE *lpbyMemPool, INT nMemSize, BYTE *lpbyPreserve, INT nPreserve, INT *pnErr);
32+
33+
// Purpose: Destroy a recognizer (free resources)
34+
// hDSpotter(IN): a handle of the recognizer
35+
// Return: Success or error code
36+
DSPDLL_API INT DSpotter_Release(HANDLE hDSpotter);
37+
38+
// Purpose: Reset recognizer
39+
// hDSpotter(IN): a handle of the recognizer
40+
// Return: Success or error code
41+
DSPDLL_API INT DSpotter_Reset(HANDLE hDSpotter);
42+
43+
// Purpose: Transfer voice samples to the recognizer for recognizing.
44+
// hDSpotter(IN): a handle of the recognizer
45+
// lpsSample(IN): the pointer of voice data buffer
46+
// nNumSample(IN): the number of voice data (a unit is a short, we prefer to add 480 samples per call)
47+
// Return: "DSPOTTER_ERR_NeedMoreSample" indicates call this function again, else call DSpotter_GetResult(...)
48+
DSPDLL_API INT DSpotter_AddSample(HANDLE hDSpotter, SHORT *lpsSample, INT nNumSample);
49+
50+
// Purpose: Get recognition results.
51+
// hDSpotter(IN): a handle of the recognizer
52+
// Return: the command ID. It is 0 based
53+
DSPDLL_API INT DSpotter_GetResult(HANDLE hDSpotter);
54+
DSPDLL_API INT DSpotter_GetResultEPD(HANDLE hDSpotter, INT *pnWordDura, INT *pnEndDelay);
55+
DSPDLL_API INT DSpotter_GetResultScore(HANDLE hDSpotter, INT *pnGMM, INT *pnSG, INT *pnFIL);
56+
57+
// Purpose: Get Cmd energy(RMS)
58+
// hDSpotter(IN): a handle of the recognizer
59+
// Return: Value or error code
60+
DSPDLL_API INT DSpotter_GetCmdEnergy(HANDLE hDSpotter);
61+
62+
//Model Param
63+
DSPDLL_API INT DSpotter_GetNumWord(BYTE *lpbyModel);
64+
65+
DSPDLL_API INT DSpotter_GetMemoryUsage_Multi(BYTE *lpbyCYBase, BYTE *lppbyModel[], INT nNumModel, INT nMaxTime);
66+
67+
DSPDLL_API const char *DSpotter_VerInfo(void);
68+
69+
70+
/************************************************************************/
71+
// Threshold Adjust API
72+
/************************************************************************/
73+
// Purpose: Set model rejection level
74+
// hDSpotter(IN): a handle of the recognizer
75+
// nRejectionLevel(IN): rejection level
76+
// Return: Success or error code
77+
DSPDLL_API INT DSpotter_SetRejectionLevel(HANDLE hDSpotter, INT nRejectionLevel);
78+
79+
// Purpose: Set model SG rejection level
80+
// hDSpotter(IN): a handle of the recognizer
81+
// nRejectionLevel(IN): SG rejection level
82+
// Return: Success or error code
83+
DSPDLL_API INT DSpotter_SetSgLevel(HANDLE hDSpotter, INT nRejectionLevel);
84+
85+
// Purpose: Set model FIL rejection level
86+
// hDSpotter(IN): a handle of the recognizer
87+
// nRejectionLevel(IN): FIL rejection level
88+
// Return: Success or error code
89+
DSPDLL_API INT DSpotter_SetFilLevel(HANDLE hDSpotter, INT nRejectionLevel);
90+
91+
// Purpose: Set engine response time
92+
// hDSpotter(IN): a handle of the recognizer
93+
// nResponseTime(IN): response time
94+
// Return: Success or error code
95+
DSPDLL_API INT DSpotter_SetResponseTime(HANDLE hDSpotter, INT nResponseTime);
96+
97+
// Purpose: Set engine energy threshold
98+
// hDSpotter(IN): a handle of the recognizer
99+
// nEnergyTH(IN): energy threshold(RMS)
100+
// Return: Success or error code
101+
DSPDLL_API INT DSpotter_SetEnergyTH(HANDLE hDSpotter, INT nEnergyTH);
102+
103+
// Purpose: Get engine energy threshold
104+
// hDSpotter(IN): a handle of the recognizer
105+
// Return: energy threshold(RMS) or error code
106+
DSPDLL_API INT DSpotter_GetEnergyTH(HANDLE hDSpotter);
107+
108+
// Purpose: Set Cmd response time
109+
// hDSpotter(IN): a handle of the recognizer
110+
// nCmdIdx(IN): the command ID. It is 0 based
111+
// nResponseTime(IN): response time
112+
// Return: Success or error code
113+
DSPDLL_API INT DSpotter_SetCmdResponseTime(HANDLE hDSpotter, INT nCmdIdx, INT nResponseTime);
114+
115+
// Purpose: Set Cmd reward
116+
// hDSpotter(IN): a handle of the recognizer
117+
// nCmdIdx(IN): the command ID. It is 0 based
118+
// nReward(IN): reward
119+
// Return: Success or error code
120+
DSPDLL_API INT DSpotter_SetCmdReward(HANDLE hDSpotter, INT nCmdIdx, INT nReward);
121+
122+
// Purpose: Get Cmd response time
123+
// hDSpotter(IN): a handle of the recognizer
124+
// nCmdIdx(IN): the command ID. It is 0 based
125+
// Return: response time or error code
126+
DSPDLL_API INT DSpotter_GetCmdResponseTime(HANDLE hDSpotter, INT nCmdIdx);
127+
128+
// Purpose: Get Cmd reward
129+
// hDSpotter(IN): a handle of the recognizer
130+
// nCmdIdx(IN): the command ID. It is 0 based
131+
// *pnErr(IN/Out): error code
132+
// Return: reward
133+
DSPDLL_API INT DSpotter_GetCmdReward(HANDLE hDSpotter, INT nCmdIdx, INT *pnErr);
134+
135+
#ifdef __cplusplus
136+
}
137+
#endif
138+
139+
#endif // __DSPOTTERSDK_API_H
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#ifndef __DSPOTTER_SDK_API_CONST_H__
2+
#define __DSPOTTER_SDK_API_CONST_H__
3+
4+
5+
#define DSPOTTER_SUCCESS ( 0 )
6+
#define DSPOTTER_ERR_SDKError ( -2000 )
7+
#define DSPOTTER_ERR_LexiconError ( -3000 )
8+
#define DSPOTTER_ERR_EngineError ( -5000 )
9+
10+
11+
/************************************************************************/
12+
// Recognition type
13+
/************************************************************************/
14+
#define DSPOTTER_RecogType_Unknown (0)
15+
#define DSPOTTER_RecogType_Passed (1)
16+
#define DSPOTTER_RecogType_NotGoodEnough (2)
17+
#define DSPOTTER_RecogType_MissStartSyllalbe (3)
18+
#define DSPOTTER_RecogType_MissEndSyllalbe (4)
19+
20+
/************************************************************************/
21+
// SD
22+
/************************************************************************/
23+
24+
/************************************************************************/
25+
// Error code
26+
/************************************************************************/
27+
28+
#define DSPOTTER_ERR_IllegalHandle ( DSPOTTER_ERR_SDKError - 1 )
29+
#define DSPOTTER_ERR_IllegalParam ( DSPOTTER_ERR_SDKError - 2 )
30+
#define DSPOTTER_ERR_LeaveNoMemory ( DSPOTTER_ERR_SDKError - 3 )
31+
#define DSPOTTER_ERR_LoadDLLFailed ( DSPOTTER_ERR_SDKError - 4 )
32+
#define DSPOTTER_ERR_LoadModelFailed ( DSPOTTER_ERR_SDKError - 5 )
33+
#define DSPOTTER_ERR_GetFunctionFailed ( DSPOTTER_ERR_SDKError - 6 )
34+
#define DSPOTTER_ERR_ParseEINFailed ( DSPOTTER_ERR_SDKError - 7 )
35+
#define DSPOTTER_ERR_OpenFileFailed ( DSPOTTER_ERR_SDKError - 8 )
36+
#define DSPOTTER_ERR_NeedMoreSample ( DSPOTTER_ERR_SDKError - 9 )
37+
#define DSPOTTER_ERR_Timeout ( DSPOTTER_ERR_SDKError - 10 )
38+
#define DSPOTTER_ERR_InitWTFFailed ( DSPOTTER_ERR_SDKError - 11 )
39+
#define DSPOTTER_ERR_AddSampleFailed ( DSPOTTER_ERR_SDKError - 12 )
40+
#define DSPOTTER_ERR_BuildUserCommandFailed ( DSPOTTER_ERR_SDKError - 13 )
41+
#define DSPOTTER_ERR_MergeUserCommandFailed ( DSPOTTER_ERR_SDKError - 14 )
42+
#define DSPOTTER_ERR_IllegalUserCommandFile ( DSPOTTER_ERR_SDKError - 15 )
43+
#define DSPOTTER_ERR_IllegalWaveFile ( DSPOTTER_ERR_SDKError - 16 )
44+
#define DSPOTTER_ERR_BuildCommandFailed ( DSPOTTER_ERR_SDKError - 17 )
45+
#define DSPOTTER_ERR_InitFixNRFailed ( DSPOTTER_ERR_SDKError - 18 )
46+
#define DSPOTTER_ERR_EXCEED_NR_BUFFER_SIZE ( DSPOTTER_ERR_SDKError - 19 )
47+
#define DSPOTTER_ERR_Rejected ( DSPOTTER_ERR_SDKError - 20 )
48+
#define DSPOTTER_ERR_NoVoiceDetect ( DSPOTTER_ERR_SDKError - 21 )
49+
#define DSPOTTER_ERR_Expired ( DSPOTTER_ERR_SDKError - 100 )
50+
#define DSPOTTER_ERR_LicenseFailed ( DSPOTTER_ERR_SDKError - 200 )
51+
52+
#define DSPOTTER_ERR_CreateModelFailed ( DSPOTTER_ERR_SDKError - 500 )
53+
#define DSPOTTER_ERR_WriteFailed ( DSPOTTER_ERR_SDKError - 501 )
54+
#define DSPOTTER_ERR_NotEnoughStorage ( DSPOTTER_ERR_SDKError - 502 )
55+
#define DSPOTTER_ERR_NoisyEnvironment ( DSPOTTER_ERR_SDKError - 503 )
56+
#define DSPOTTER_ERR_VoiceTooShort ( DSPOTTER_ERR_SDKError - 504 )
57+
#define DSPOTTER_ERR_VoiceTooLong ( DSPOTTER_ERR_SDKError - 505 )
58+
59+
#endif //__DSPOTTER_SDK_API_CONST_H__
60+
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
/*
2+
FreeRTOS V8.0.0 - Copyright (C) 2014 Real Time Engineers Ltd.
3+
All rights reserved
4+
5+
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
6+
7+
***************************************************************************
8+
* *
9+
* FreeRTOS provides completely free yet professionally developed, *
10+
* robust, strictly quality controlled, supported, and cross *
11+
* platform software that has become a de facto standard. *
12+
* *
13+
* Help yourself get started quickly and support the FreeRTOS *
14+
* project by purchasing a FreeRTOS tutorial book, reference *
15+
* manual, or both from: http://www.FreeRTOS.org/Documentation *
16+
* *
17+
* Thank you! *
18+
* *
19+
***************************************************************************
20+
21+
This file is part of the FreeRTOS distribution.
22+
23+
FreeRTOS is free software; you can redistribute it and/or modify it under
24+
the terms of the GNU General Public License (version 2) as published by the
25+
Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.
26+
27+
>>! NOTE: The modification to the GPL is included to allow you to distribute
28+
>>! a combined work that includes FreeRTOS without being obliged to provide
29+
>>! the source code for proprietary components outside of the FreeRTOS
30+
>>! kernel.
31+
32+
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
33+
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
34+
FOR A PARTICULAR PURPOSE. Full license text is available from the following
35+
link: http://www.freertos.org/a00114.html
36+
37+
1 tab == 4 spaces!
38+
39+
***************************************************************************
40+
* *
41+
* Having a problem? Start by reading the FAQ "My application does *
42+
* not run, what could be wrong?" *
43+
* *
44+
* http://www.FreeRTOS.org/FAQHelp.html *
45+
* *
46+
***************************************************************************
47+
48+
http://www.FreeRTOS.org - Documentation, books, training, latest versions,
49+
license and Real Time Engineers Ltd. contact details.
50+
51+
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
52+
including FreeRTOS+Trace - an indispensable productivity tool, a DOS
53+
compatible FAT file system, and our tiny thread aware UDP/IP stack.
54+
55+
http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
56+
Integrity Systems to sell under the OpenRTOS brand. Low cost OpenRTOS
57+
licenses offer ticketed support, indemnification and middleware.
58+
59+
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
60+
engineered and independently SIL3 certified version for use in safety and
61+
mission critical applications that require provable dependability.
62+
63+
1 tab == 4 spaces!
64+
*/
65+
66+
#ifndef FREERTOS_CONFIG_H
67+
#define FREERTOS_CONFIG_H
68+
69+
#include <stdio.h>
70+
/*-----------------------------------------------------------
71+
* Application specific definitions.
72+
*
73+
* These definitions should be adjusted for your particular hardware and
74+
* application requirements.
75+
*
76+
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
77+
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
78+
*
79+
* See http://www.freertos.org/a00110.html.
80+
*----------------------------------------------------------*/
81+
82+
#define configUSE_PREEMPTION 1
83+
#define configUSE_IDLE_HOOK 0
84+
#define configUSE_TICK_HOOK 0
85+
#define configCPU_CLOCK_HZ ( ( unsigned long ) BOARD_CPU_CLOCK )
86+
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
87+
#define configMAX_PRIORITIES ( 10 )
88+
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 104 )
89+
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 32 * 1024 ) )
90+
#define configMAX_TASK_NAME_LEN ( 10 )
91+
#define configUSE_TRACE_FACILITY 0
92+
#define configUSE_16_BIT_TICKS 0
93+
#define configIDLE_SHOULD_YIELD 1
94+
#define configUSE_MUTEXES 1
95+
96+
/* Co-routine definitions. */
97+
#define configUSE_CO_ROUTINES 0
98+
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
99+
100+
101+
/* Set the following definitions to 1 to include the API function, or zero
102+
to exclude the API function. */
103+
104+
#define INCLUDE_vTaskPrioritySet 1
105+
#define INCLUDE_uxTaskPriorityGet 1
106+
#define INCLUDE_vTaskDelete 1
107+
#define INCLUDE_vTaskCleanUpResources 0
108+
#define INCLUDE_vTaskSuspend 1
109+
#define INCLUDE_vTaskDelayUntil 1
110+
#define INCLUDE_vTaskDelay 1
111+
#define INCLUDE_xTaskGetCurrentTaskHandle 1
112+
113+
#endif /* FREERTOS_CONFIG_H */
384 Bytes
Binary file not shown.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//convert from Group_1.mod
2+
#define Group_1_mod_DIRNAME "NCKU_MacTavish"
3+
#define Group_1_mod_DATE "20200714"
4+
const static int Group_1_mod_byte_size=384;
5+
const static unsigned int pGroup_1_mod[]= {
6+
0x44485943u, 0x00000180u, 0x00000040u, 0x4a4e494eu, 0x4e4e5f41u, 0x00010008u, 0x0e0707e4u, 0x5f0d1696u, 0x3e800020u, 0x00a00200u, 0x00020017u, 0x00000000u,
7+
0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0xfffb0069u, 0x000afff1u, 0x0005001eu, 0x001e003cu, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
8+
0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
9+
0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
10+
0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
11+
0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
12+
0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x00000001u, 0x00000016u, 0x00000017u, 0x00000000u,
13+
0x00000008u, 0x002d0014u, 0x02c700f1u, 0x02ed02dau, 0x028500aau, 0x02d101dbu, 0x031202a3u, 0x014c019du, 0x009200e1u, 0x030f013au, 0x00b90172u, 0x0000005cu
14+
};
1.59 KB
Binary file not shown.

0 commit comments

Comments
 (0)