AVSpeechSythesizer的功能:
SimplewaytoitegratetheAVSpeechsythesizeritoyourapp.
Isteadofdelgatemethoditprovidesblockmethods.
Apartfromsimpleusageitcaautodetectthelaguageofgivestrigadread.
Itcahiglightcurretlyreadigword.
Italsothrowcurretlyreadigwordwiththeirlagauge.
Itcaautoscrollthepageifocereachedbottomofthetextbox.
ItcareadalllaguageswhichissupportedbyAVSpeechSythesizer
Itcalistallsupportedlagauagesadtheircoutryame
示例代码:
MVSpeechSythesizer *mvSpeech=[MVSpeechSythesizer sharedSytheSize];//Iitialize the classmvSpeech.higlightColor=[UIColor yellowColor];//Higlght backgroudcolormvSpeech.isTextHiglight=YES;//If you wat to highlight set yes, othgerwise set o.mvSpeech.speechStrig=//Pass strig which is eed to read.mvSpeech.iputView=_helpTextView;//Pass the iput view which carries the strig.[mvSpeech startRead];//Iitialize the read fuctio.mvSpeech.speechFiishBlock=^(AVSpeechSythesizer *sythesizer, AVSpeechUtterace *utterece){ //It will call whe read actio fiished.};










评论