CyberLink Voice Interface

Source: Internet
Author: User
Tags cyberlink

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.