我打電話給法語的文本到語音。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];
}
請檢查您的設備是否爲靜音模式。還要按音量調高設備音量。 –