【发布时间】:2017-06-03 20:06:44
【问题描述】:
我正在调用法语的文本到语音。
这在: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 objective-c iphone text-to-speech