我正在用法语讲文本。

这可以按预期工作: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];
}

最佳答案

事实证明,语音合成器是由铃声音量而不是媒体音量控制的。铃声已在测试仪的设备上静音。

关于ios - iOS 10.3文本语音转换可在模拟器上运行,但不能在设备上运行,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/44255097/

10-11 23:01
查看更多