科大訊飛語音識別使用過程中踩過的坑

2021-07-14 13:08:32 字數 1894 閱讀 4977

眨眼之間又是好久沒有寫部落格了,佩服那些寫了很多部落格的大神,堅持和耐心值得我學習

這次寫的是乙個知名的語音識別sdk,就是科大訊飛的語音識別,其實也沒有多複雜,但是由於我是用swift語言,期間出了很多差錯 ,搞了好久,在這裡就慢慢記錄下來吧。

#import "iflymsc/iflyspeechrecognizerdelegate.h"

#import "iflymsc/iflyspeechrecognizer.h"

#import "iflymsc/iflyrecognizerviewdelegate.h"

#import "iflymsc/iflyrecognizerview.h"

#import "iflymsc/iflycontact.h"

#import "iflymsc/iflyuserwords.h"

#import "iflymsc/iflydatauploader.h"

#import "iflymsc/iflyspeechsynthesizerdelegate.h"

#import "iflymsc/iflyspeechsynthesizer.h"

#import "iflymsc/iflyspeechutility.h"

#import "iflymsc/iflyspeechconstant.h"

#import "iflymsc/iflyspeecherror.h"

#import "iflymsc/iflyspeechunderstander.h"

#import "iflymsc/iflytextunderstander.h"

#import "iflymsc/iflysetting.h"

無介面:

class viewcontroller: uiviewcontroller,iflyspeechrecognizerdelegate,uitextviewdelegate
func

startvoicebtn()

func

onresults(results: [

anyobject

]!, islast:

bool) }

ifresulttext

!= ""

}resulttext

+= resultstr

voicetextview

.text

= resulttext

}func

onerror(errorcode:

iflyspeecherror

!) }

其實沒有多少注意的地方,就是遵循那個**,然後實現兩個**方法就行了,真機測試之後就會發現,在onreaults中就能列印出識別的文字了,然後根據自己的需求不同來對字串進行處理,這裡特別注意的是聯網,真機測試,然後用普通話說出想要識別的文字,如果光發出聲響,他就會一直報識別錯誤的錯。

有介面:

import uikit

class voiceviewcontroller: uiviewcontroller,iflyrecognizerviewdelegate

func startvoicebtn()

func onresult(results: [anyobject]!,islast: bool)

}if resulttext != ""

}resulttext += resultstr

textview.text = resulttext

if isrecongnizer else }}

func onerror(error: iflyspeecherror!)

關於訊飛語音聽寫使用過程中出現的問題

音聽寫 語音轉文字 的功能實現,決定採用訊飛語音實現,但過程中出現的問題確實令人摸不著頭腦 話說我之前都沒遇到過哎 還好後來都被我解決掉了。特此記錄,以備檢視。1.第乙個問題是int ret miat.startlistening recognizerlistener 呼叫完成後得到的ret不是正常...

appium使用過程中的踩坑集

2.埠拒絕訪問 錯誤 urllib3.exceptions.maxretryerror httpconnectionpool host 127.0.0.1 port 4725 max retries exceeded with url wd hub session caused by newconn...

robotframework使用過程中的一些總結

robot framework是乙個基於python可擴充套件地關鍵字驅動的測試自動化框架,robot framework被廣泛地使用在端到端地驗收測試以及驗收測試驅動開發的過程中。1.在rf中輸入部分關鍵字的名稱時,使用shift control 空格可以延伸出所有相關的關鍵字 2.suit下打t...