代码之家  ›  专栏  ›  技术社区  ›  ijason03

iOS 12上出现语音混乱

  •  1
  • ijason03  · 技术社区  · 7 年前

    我有一个使用avspeechutrance的应用程序,在ios 12之前一直运行良好。它仍然有效,但美国的声音听起来乱七八糟。这不会发生在Xcode模拟器或新的iPhone XS Max上。它似乎只发生在iPhone X上。删除和重新安装应用程序并不能解决问题。唯一的办法就是把声音改成en-ie。 有没有其他人经历过或找到了解决办法??

    AVSpeechUtterance *utterance = [[AVSpeechUtterance alloc] initWithString:@"This is a test"];
    utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"en-US"];
    utterance.rate = AVSpeechUtteranceDefaultSpeechRate;
    [self.synthesizer speakUtterance:utterance];
    
    1 回复  |  直到 7 年前
        1
  •  1
  •   Mute Dan    7 年前

    ios12在我们中间使用 弗莱德 而不是 萨曼莎 ,

    尝试替换:

    utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"en-US"];
    

    用:

    utterance.voice = [AVSpeechSynthesisVoice voiceWithIdentifier:@"com.apple.ttsbundle.Samantha-compact"];
    
    推荐文章