Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/117.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 AVSpeechSynthesizer不能使用印地语_Ios_Swift_Avspeechsynthesizer - Fatal编程技术网

Ios AVSpeechSynthesizer不能使用印地语

Ios AVSpeechSynthesizer不能使用印地语,ios,swift,avspeechsynthesizer,Ios,Swift,Avspeechsynthesizer,导入的AVFoundation,可以很好地使用英语字符串,但不能使用印地语字符串。当我将我的iPhone语言从我不想要的设置更改为印地语时,它就起作用了。如何在不将iPhone语言更改为印地语(iPhone语言为英语)的情况下使用此代码 let synth = AVSpeechSynthesizer() var myUtterance = AVSpeechUtterance(string: "") override func viewDidLoad() { Speak() } func

导入的AVFoundation,可以很好地使用英语字符串,但不能使用印地语字符串。当我将我的iPhone语言从我不想要的设置更改为印地语时,它就起作用了。如何在不将iPhone语言更改为印地语(iPhone语言为英语)的情况下使用此代码

let synth = AVSpeechSynthesizer()
var myUtterance = AVSpeechUtterance(string: "")

override func viewDidLoad() {

  Speak()
}

func speak(){
    self.myUtterance = AVSpeechUtterance(string: "ऑर्डर स्थिति अपडेट कर दी गई है")
    myUtterance.voice = AVSpeechSynthesisVoice(language: "hi-IN")
    self.synth.speak(self.myUtterance)
}
下面是我的代码:

let synth = AVSpeechSynthesizer()
var myUtterance = AVSpeechUtterance(string: "")

override func viewDidLoad() {
      myUtterance.voice = AVSpeechSynthesisVoice(language: "hi-IN")
      Speak()
}

func speak(){
       self.myUtterance = AVSpeechUtterance(string: "ऑर्डर स्थिति अपडेट कर दी गई है")
                self.synth.speak(self.myUtterance)
}
let synth = AVSpeechSynthesizer()
var myUtterance = AVSpeechUtterance(string: "")

override func viewDidLoad() {

  Speak()
}

func speak(){
    self.myUtterance = AVSpeechUtterance(string: "ऑर्डर स्थिति अपडेट कर दी गई है")
    myUtterance.voice = AVSpeechSynthesisVoice(language: "hi-IN")
    self.synth.speak(self.myUtterance)
}

提前谢谢你

已解决:我更改了一条线的位置及其工作状态。我将字符串设置为myoutrance后设置了语言

let synth = AVSpeechSynthesizer()
var myUtterance = AVSpeechUtterance(string: "")

override func viewDidLoad() {

  Speak()
}

func speak(){
    self.myUtterance = AVSpeechUtterance(string: "ऑर्डर स्थिति अपडेट कर दी गई है")
    myUtterance.voice = AVSpeechSynthesisVoice(language: "hi-IN")
    self.synth.speak(self.myUtterance)
}