<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                [TOC] ## 語音喚醒 語音喚醒集成流程如下: ![](https://box.kancloud.cn/a0114603388aa2646c97990e37e97604_434x446.png) 使用示例如下所示:(*注意,啟動喚醒需要關注系統錄音權限,目前iOS喚醒只支持應用級喚醒。*) ~~~ #import "iflyMSC/IFlyMSC.h" //獲取喚醒單例對象 _iflyVoiceWakeuper = [IFlyVoiceWakeuper sharedInstance]; //設置喚醒協議委托 _iflyVoiceWakeuper.delegate = self; //設置喚醒參數 //生成喚醒資源路徑,喚醒資源需要定制,與喚醒詞一一對應。 NSString *wordPath = [[NSBundle mainBundle] pathForResource:@"ivwres/wakeresource" ofType:@"irf"]; NSString *ivwResourcePath = [[NSString alloc] initWithFormat:@"fo|%@",wordPath]; //設置喚醒資源,并啟動喚醒引擎 [[IFlySpeechUtility getUtility] setParameter:[NSString stringWithFormat: @"engine_start=ivw,ivw_res_path=%@",ivwResourcePath] forKey:[IFlyResourceUtil ENGINE_START]]; //設置喚醒門限值 //門限設置要和資源中的喚醒詞個數匹配,以;分割。 //例如:0:-20,0代表第一個喚醒詞 -20,代表第一個喚醒詞門限 //根據下載的SDK中的說明來設置。 //0:表示第一個喚醒詞,-20表示喚醒詞對應的門限值; //1:表示第二個喚醒詞,-20表示喚醒詞對應的門限值 [_iflyVoiceWakeuper setParameter:@"0:-20;1:-20;" forKey:@"ivw_threshold"]; //設置喚醒的服務類型,目前僅支持wakeup [_iflyVoiceWakeuper setParameter:@"wakeup" forKey:@"ivw_sst"]; //設置喚醒的工作模式 //keep_alive表示一次喚醒成功后是否繼續錄音等待喚醒。1:表示繼續;0:表示喚醒終止 [_iflyVoiceWakeuper setParameter:@"1" forKey:@"keep_alive"]; //啟動喚醒 int bRet = [self.iflyVoiceWakeuper startListening]; //喚醒實現delegate //錄音開始 -(void) onBeginOfSpeech{} //錄音結束 -(void) onEndOfSpeech{} //會話錯誤 -(void) onError:(IFlySpeechError *)error{} //音量變化回調 - (void) onVolumeChanged: (int)volume{} //喚醒結果回調 -(void) onResult:(NSMutableDictionary *)resultArray{} ~~~ ## 語音喚醒OneShot oneshot是喚醒的一種擴展方式,支持喚醒+識別,喚醒+聽寫,喚醒+語義的組合解決方案。 此處介紹喚醒+識別模式,可以適用于喚醒詞數量有限,而命令詞又無法常駐運行的場景。在游戲場景下,可采用聲控的方式來操控游戲。例如:定義喚醒詞為阿里巴巴,定義命令詞序列:“打開城門”,“發起攻擊”,這樣就形成若干命令序列。用戶可以說: - 阿里巴巴打開城門 - 阿里巴巴發起攻擊 除了游戲外,用戶可以很容易的將喚醒+識別的應用擴展到其他領域,比如家電,車載等比較適合語音的場所。 ### 詳細demo 喚醒+識別的代碼比較復雜,限于篇幅不在本文檔描述,詳細過程可以參考Demo中的OneshotViewController示例代碼。 Demo的示例,用戶可以說 訊飛語音/訊飛語點 + 張三/李四/張海洋 的組合。 ### 使用喚醒+識別步驟 ![](https://box.kancloud.cn/85f3e02218da898bfc414199554b4b85_213x350.png) ### 喚醒+識別回調 ~~~ //錄音開始 - (void) onBeginOfSpeech{} //錄音結束 - (void) onEndOfSpeech{} //音量回調 - (void) onVolumeChanged: (int)volume{} //服務結束回調 - (void) onError:(IFlySpeechError *) error{} //喚醒結果回調 - (void) onResult:(NSMutableDictionary *)resultArray {} //會話事件回調 - (void) onEvent:(int)eventType isLast:(BOOL)isLast arg1:(int)arg1 data:(NSMutableDictionary *)eventData(){} ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看