我刚刚下载了用于iOS开发的Dragon Mobile SDK,正在尝试用SpeechKit创建一个应用程序。我遵循了Dragon Mobile SDK参考,但我在日志中不断收到以下消息:
2014-12-11 23:24:52.834 TestApp[17554:1036858] [NMSP_DEBUG] nmsp_nmas_create_dictionary().
2014-12-11 23:24:52.835 TestApp[17554:1036858] [NMSP_DEBUG] nmsp_nmas_dictionary_add().
2014-12-11 23:24:52.835 TestApp[17554:1036858] [NMSP_DEBUG] nmsp_nmas_dictionary_key_exists
2014-12-11 23:24:52.835 TestApp[17554:1036858] [NMSP_DEBUG] nmsp_nmas_dictionary_add().
2014-12-11 23:24:52.836 TestApp[17554:1036858] [NMSP_DEBUG] nmsp_nmas_dictionary_key_exists下面是我的代码:
- (IBAction)startRecording:(id)sender {
self.vocalizer = [[SKVocalizer alloc] initWithLanguage:@"en_US"
delegate:self];
[self.vocalizer speakString:@"Hello world."];
}代码运行时什么也不会发生。我已经仔细检查并确保密钥是正确的,并且我已经下载了正确的框架,所以我不知道问题出在哪里。任何帮助都将不胜感激!
发布于 2014-12-14 06:02:46
刚刚弄明白为什么会发生这种事!我在AppDelegate中添加了以下函数(根据Ray Wenderlich的教程)
- (void)setupSpeechKitConnection {
[SpeechKit setupWithID:INSERT_YOUR_APPLICATION_ID_HERE
host:INSERT_YOUR_HOST_ADDRESS_HERE
port:INSERT_YOUR_HOST_PORT_HERE
useSSL:NO
delegate:nil];
// Set earcons to play
SKEarcon* earconStart = [SKEarcon earconWithName:@"earcon_listening.wav"];
SKEarcon* earconStop = [SKEarcon earconWithName:@"earcon_done_listening.wav"];
SKEarcon* earconCancel = [SKEarcon earconWithName:@"earcon_cancel.wav"];
[SpeechKit setEarcon:earconStart forType:SKStartRecordingEarconType];
[SpeechKit setEarcon:earconStop forType:SKStopRecordingEarconType];
[SpeechKit setEarcon:earconCancel forType:SKCancelRecordingEarconType];
}但它没有被调用。当我把它移到ViewController中的viewDidLoad时,它开始工作了。
https://stackoverflow.com/questions/27436919
复制相似问题