小编Ant*_*nio的帖子

iOS 10.3 文本转语音可以在模拟器上运行,但不能在设备上运行

我正在调用法语文本转语音功能。

这在以下设备上按预期工作:iOS 9.3模拟器、iOS 9.3设备 ( iPad 3rd gen)、iOS 10.3模拟器。不能在iOS 10.3设备 ( iPhone 6s) 上(静默)工作。

默认法语语音已安装并根据设备设置运行。

static AVSpeechSynthesizer* synthesizer = NULL;
//...
+(void)readText:(NSString*)text
{
    if(synthesizer == NULL)
      synthesizer = [[AVSpeechSynthesizer alloc] init];
    AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:text];
    utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"fr-FR"];
    [synthesizer speakUtterance:utterance];
}
Run Code Online (Sandbox Code Playgroud)

iphone objective-c text-to-speech ios

1
推荐指数
1
解决办法
806
查看次数

标签 统计

ios ×1

iphone ×1

objective-c ×1

text-to-speech ×1