Linux?????????С???
???????????? ???????[ 2014/12/26 13:50:32 ] ????????Linux ??????? ??????
????????????????????????????????????????????????????????????????SDK????????Щ??????????Щ???????????linux???????????????????????????????????~
??????????????????SDK-linux?汾???????????????????????????include??????£???????????msp_errors.h msp_types.h qisr.h qtts.h??????????????Щ?????????μ?qisr.h??????????????????qtts.h??????????????????????????????????????????????????include??qisr.h????OK??????bin??????±????????????libmsc.so??libspeex.so????????????????????????????/usr/lib???檔
??????bin?????????????asr_keywords_utf8.txt??????????SDK???·???????????????????????д??asr_keywords_utf8.txt?У?????????????????????????????GrammarID???????????“??????Ч”??????????????????÷???????????????????GrammarID????????????????????????????????ú???????????????“?????????£??????????”??????Щ????д??asr_keywords_utf8.txt?У??????????utf-8???????????linux?????????????????д????????txt?????GrammarID?????
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <qisr.h>
#define TRUE 1
#define FALSE 0
int main()
{
int ret = QISRInit("appid=xxxxxxx");
if(ret != MSP_SUCCESS)
{
printf("QISRInit with errorCode: %d
"?? ret);
return 0;
}
char GrammarID[128];
memset(GrammarID?? 0?? sizeof(GrammarID));
const int MAX_KEYWORD_LEN = 4096;
ret = MSP_SUCCESS;
const char * sessionID = NULL;
sessionID = QISRSessionBegin(NULL?? "ssm=1??sub=asr"?? &ret);
if(ret != MSP_SUCCESS)
{
printf("QISRSessionBegin with errorCode: %d
"?? ret);
return ret;
}
char UserData[MAX_KEYWORD_LEN];
memset(UserData?? 0?? MAX_KEYWORD_LEN);
FILE* fp = fopen("asr_keywords_utf8.txt"?? "rb");
if (fp == NULL)
{
printf("keyword file cannot open
");
return -1;
}
unsigned int len = (unsigned int)fread(UserData?? 1?? MAX_KEYWORD_LEN?? fp);
UserData[len] = 0;
fclose(fp);
const char* testID = QISRUploadData(sessionID?? "contact"?? UserData?? len?? "dtt=keylist"?? &ret);
if(ret != MSP_SUCCESS)
{
printf("QISRUploadData with errorCode: %d
"?? ret);
return ret;
}
memcpy((void*)GrammarID?? testID?? strlen(testID));
printf("GrammarID: "%s"
"?? GrammarID);
QISRSessionEnd(sessionID?? "normal");
return 0;
}
|
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11