I'm not going to talk about it, honestly, I didn't know about it before last night. Because I now only use the speech synthesis, the text will be converted to speech, so the method of speech synthesis first listed.
First add a Frame
Iflymsc.framework,
LIBZ.DYLIB/LIBZ.TBD (xcode7.x)
Avfoundation.framework
Systemconfiguration.framework
Foundation.framework
Coretelephoney.framework
Audiotoolbox.framework
Uikit.framework
Corelocation.framework
Addressbook.framework
Quartzcore.framework
Coregraphics.framework
To tell the truth, the framework is many, and most of them are currently not available, but considering the future of this article will continue to increase, so just post it.
//set the log level of the SDK, log saved in the working path set below[iflysetting Setlogfile:lvl_all]; //Open the log switch of the output on the console[iflysetting Showlogcat:yes]; //set the working path of the SDKNSString *paths=nssearchpathfordirectoriesindomains (Nscachesdirectory, Nsuserdomainmask, YES) [0]; [Iflysetting setlogfilepath:paths]; //To Create a voice configuration, AppID must be passed in and executed only once toNSString *initstring=[[nsstring Alloc]initwithformat:@"appid=%@", Appid_value]; //before all services are started, you need to ensure that createutility is executed[Iflyspeechutility createutility:initstring];
Speech synthesis
@interface Viewcontroller () <IFlySpeechSynthesizerDelegate>
{
Service agents that need to implement iflyspeechsynthesizerdelegate compositing sessions
Iflyspeechsynthesizer *_iflyspeechsynthesizer;
}
-(Ibaction) Read: (UIButton *) Sender {//1. Create a Composition object_iflyspeechsynthesizer=[Iflyspeechsynthesizer sharedinstance]; _iflyspeechsynthesizer.Delegate=Self ; //2. Setting Composition Parameters//set up how to work online[_iflyspeechsynthesizer setparameter:[iflyspeechconstant Type_cloud] forkey:[iflyspeechconstant ENGINE_TYPE]; //volume, value range 0~100[_iflyspeechsynthesizer Setparameter:@" -"forkey:[iflyspeechconstant VOLUME]]; //Speaking Speed[_iflyspeechsynthesizer Setparameter:@" the"forkey:[iflyspeechconstant Speed]]; //pronunciation person, default is "XiaoYan", can set the parameter list can refer to "Synthetic pronunciation person list"[_iflyspeechsynthesizer Setparameter:@"XiaoYan"forkey:[iflyspeechconstant Voice_name]]; //Save the composition file name, if no longer required, set to nil or null to cancel, default directory is located under Library/cache[_iflyspeechsynthesizer Setparameter:@"TTS.PCM"forkey:[iflyspeechconstant Tts_audio_path]]; //3. Start a composition session[_iflyspeechsynthesizer startspeaking:_world.text];}
Iflyspeechsynthesizerdelegate protocol method
//End Agent-(void) oncompleted: (Iflyspeecherror *) error{NSLog (@"End Agent");}//Synthesis begins-(void) onspeakbegin{NSLog (@"Synthesis begins");}//Synthesis Buffering Progress-(void) Onbufferprogress: (int) Progress message: (NSString *) msg{NSLog (@"Synthesis Buffering Progress");}//Composition Playback Progress-(void) Onspeakprogress: (int) progress{NSLog (@"Synthesis Buffering Progress");}
PS: To be honest, it feels like copying from a Help document.
CyberLink Voice Interface