2016-05-26 17:28:33.374 E|BDSTTSEngine.mm:856 get license failed: -101
2016-05-26 17:28:33.375 E|BDSTTSEngine.mm:742 failed to get license from server
2016-05-26 17:28:33.376 E|BDSSpeechSynthesizer_Combined.mm:386 start tts engine failed
===以下贴代码====
- (void)configBaiduSpeech {
[BDSSpeechSynthesizer setLogLevel:BDS_PUBLIC_LOG_DEBUG];
[[BDSSpeechSynthesizer sharedInstance] setSynthesizerDelegate:self];
[self configOnlineTTS];
[self configOfflineTTS];
}
- (void)configOnlineTTS {
[[BDSSpeechSynthesizer sharedInstance] setApiKey:Baidu_APPKEY withSecretKey:Baidu_SecretKEY];
}
- (void)configOfflineTTS {
[[BDSSpeechSynthesizer sharedInstance] setSynthParam:[NSNumber numberWithFloat:10.0]
forKey:BDS_SYNTHESIZER_PARAM_ONLINE_REQUEST_TIMEOUT];
// 离线相关设置
NSError* ret=[[BDSSpeechSynthesizer sharedInstance] loadOfflineEngine:
[[NSBundle mainBundle] pathForResource:@"Chinese_Text" ofType:@"dat"]
speechDataPath:
[[NSBundle mainBundle] pathForResource:@"Chinese_Speech_Female" ofType:@"dat"]
licenseFilePath:
[[NSBundle mainBundle] pathForResource:@"offline_engine_tmp_license" ofType:@"dat"]
withAppCode:Baidu_APPID];
if (ret != nil) {
[[BDSSpeechSynthesizer sharedInstance] setSynthParam:[NSNumber numberWithInt:BDS_SYNTHESIZER_SPEAKER_FEMALE]
forKey:BDS_SYNTHESIZER_PARAM_SPEAKER];
[[BDSSpeechSynthesizer sharedInstance] setSynthParam:[NSNumber numberWithInt:5]
forKey:BDS_SYNTHESIZER_PARAM_VOLUME];
[[BDSSpeechSynthesizer sharedInstance] setSynthParam: [NSNumber numberWithInt:5]
forKey:BDS_SYNTHESIZER_PARAM_SPEED ];
[[BDSSpeechSynthesizer sharedInstance] setSynthParam: [NSNumber numberWithInt:5]
forKey:BDS_SYNTHESIZER_PARAM_AUDIO_ENCODING];
[[BDSSpeechSynthesizer sharedInstance] setSynthParam:[NSNumber numberWithInt: BDS_SYNTHESIZER_AUDIO_ENCODE_MP3_16K]
forKey:BDS_SYNTHESIZER_PARAM_AUDIO_ENCODING ];
}
[UIApplication sharedApplication].idleTimerDisabled = YES;
}
离线授权问题,如使用正式授权,请移除历史授权文件。