我正在为设备上的文本到语音项目执行以下代码,但出现错误“为 Assets 构建 MacinTalk 语音:(空)” 请帮助我解决问题或提示问题所在。
AVSpeechSynthesizer *synthesizer = [[AVSpeechSynthesizer alloc]init];
AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:@"Tips For Silicon Valley From A Startup Accelerator In Gaza"];
[utterance setRate:0.015f];
utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"en-GB"];
[synthesizer speakUtterance:utterance];
最佳答案
如果它和我看到的一样,那么它真的不是错误 - 它是日志的输出和一个小麻烦,但可以忽略。引用“null”令人担忧,但 speechSynthesizer 仍在正常工作并正常说话,用户不会在真实设备上看到此消息。我从 iOS9 之后才看到这个,可能是在开发过程中他们忘记关闭的日志事件打开了。
关于ios - 为什么我在 iOS 设备测试中得到 "Building MacinTalk voice for asset: (null)",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32774480/