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