Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/121.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios AVSpeech合成器高质量语音_Ios_Avspeechsynthesizer - Fatal编程技术网

Ios AVSpeech合成器高质量语音

Ios AVSpeech合成器高质量语音,ios,avspeechsynthesizer,Ios,Avspeechsynthesizer,是否可以将增强/高质量语音(美国的Alex)与语音合成器一起使用?我已经下载了声音,但没有办法告诉合成器使用它,而不是默认的声音 由于语音通常由BCP-47代码选择,并且只有美国英语有on,因此似乎无法进一步区分语音。我错过什么了吗?(有人会认为苹果可能考虑了不同方言的需求,但我没有看到) TIA.这是iOS早期版本中的一个缺陷,即使用合成器的应用程序没有使用增强语音。此错误已在iOS10中修复。iOS10现在使用增强型语音。是的,可以从我的系统上可用的2个语音中选择,如下所示: class S

是否可以将增强/高质量语音(美国的Alex)与语音合成器一起使用?我已经下载了声音,但没有办法告诉合成器使用它,而不是默认的声音

由于语音通常由BCP-47代码选择,并且只有美国英语有on,因此似乎无法进一步区分语音。我错过什么了吗?(有人会认为苹果可能考虑了不同方言的需求,但我没有看到)


TIA.

这是iOS早期版本中的一个缺陷,即使用合成器的应用程序没有使用增强语音。此错误已在iOS10中修复。iOS10现在使用增强型语音。

是的,可以从我的系统上可用的2个语音中选择,如下所示:

class Speak {

    let voices = AVSpeechSynthesisVoice.speechVoices()
    let voiceSynth = AVSpeechSynthesizer()
    var voiceToUse: AVSpeechSynthesisVoice?

  init(){
    for voice in voices {
      if voice.name == "Samantha (Enhanced)"  && voice.quality == .enhanced {
        voiceToUse = voice
      }
    }    
  }

    func sayThis(_ phrase: String){
      let utterance = AVSpeechUtterance(string: phrase)
          utterance.voice = voiceToUse
          utterance.rate = 0.5

        voiceSynth.speak(utterance) 
    }
}
然后,在应用程序的某个地方,执行以下操作:

let voice = Speak()
voice.sayThis("I'm speaking better Seppo, now!")

有同样的问题,在我看来,它目前只是被打破,因为这应该是工作。根据文档,如果可用,它应该自动使用增强的语音。