首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >NSSpeechSynthesizer不写入AIFF文件

NSSpeechSynthesizer不写入AIFF文件
EN

Stack Overflow用户
提问于 2014-10-23 16:06:21
回答 1查看 161关注 0票数 2

在OS X 10.9.4上使用Xcode 5.1.1时,请考虑以下代码片段:

代码语言:javascript
复制
- (IBAction)speak:(id)sender        // text to loudspeaker, this works
{
   [self setup];         // provide the synthesizer with its parameters
   [speaker startSpeakingString: [textEntry stringValue]];
}


- (IBAction)storeSpeech:(id)sender  // does not work
{
   [self setup];         // provide the synthesizer with its parameters
   [NSURL *outputFile =
          [NSURL URLWithString:@"speech.aiff"];
   [speaker startSpeakinString: [textEntry stringValue]
          toURL:outputFile];   // the aiff-file is not created, why not?
}

方法扬声器输出到计算机扬声器。这个可以正常工作。

方法storeSpeech不创建任何aiff文件。为什么不行?

EN

回答 1

Stack Overflow用户

发布于 2014-10-23 17:43:53

"speech.aiff“不是什么网址,对吧?

可以使用以file://开头的URL,也可以使用路径和创建文件URL的方法。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26523713

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档