AVSpeechSynthesizer的功能:
SimplewaytointegratetheAVSpeechsynthesizerintoyourapp.
Insteadofdelgatemethoditprovidesblockmethods.
Apartfromsimpleusageitcanautodetectthelanguageofgivenstringandread.
Itcanhiglightcurrentlyreadingword.
Italsothrowcurrentlyreadingwordwiththeirlangauge.
Itcanautoscrollthepageifoncereachedbottomofthetextbox.
ItcanreadalllanguageswhichissupportedbyAVSpeechSynthesizer
Itcanlistallsupportedlangauagesandtheircountryname
示例代码:
MVSpeechSynthesizer *mvSpeech=[MVSpeechSynthesizer sharedSyntheSize];//Initialize the classmvSpeech.higlightColor=[UIColor yellowColor];//Higlght backgroundcolormvSpeech.isTextHiglight=YES;//If you want to highlight set yes, othgerwise set no.mvSpeech.speechString=//Pass string which is need to read.mvSpeech.inputView=_helpTextView;//Pass the input view which carries the string.[mvSpeech startRead];//Initialize the read function.mvSpeech.speechFinishBlock=^(AVSpeechSynthesizer *synthesizer, AVSpeechUtterance *utterence){ //It will call when read action finished.};
评论