예제 #1
0
 /// <summary>
 /// 构建语法-回调函数
 /// </summary>
 /// <param name="errorCode"></param>
 /// <param name="info"></param>
 /// <param name="userData"></param>
 /// <returns></returns>
 static int grammarCallBack(int errorCode, string info, QISRUserData userData)
 {
     Debug.Log("语法构建结果:" + errorCode);
     grammar_id       = info;
     waitGrmBuildFlag = 1;
     return(0);
 }
예제 #2
0
    /// <summary>
    /// 构建语法网络
    /// </summary>
    int GrammarBuild(string grm_type, string file)
    {
        string @params = "engine_type=local,asr_res_path=fo|res/asr/common.jet, sample_rate=16000, grm_build_path=res/asr/GrmBuilld";
        //string @params = "engine_type=cloud,sample_rate=16000";
        string       grm_content = File.ReadAllText(@"call.bnf", Encoding.Default);
        uint         grm_cnt_len = (uint)System.Text.Encoding.Default.GetBytes(grm_content).Length;
        QISRUserData userdata    = getUserData();

        Debug.Log(grm_content);
        return(MSC.QISRBuildGrammar(grm_type, grm_content, grm_cnt_len, @params, grammarCallBack, ref userdata));
    }