class ViewController: UIViewController {
let speakTalk = AVSpeechSynthesizer()
let phrase1 = AVSpeechUtterance(string: "నాకు నీరు కావాలి")//*Telugu translation for i want water//*
@IBOutlet weak var iwantwater: UIButton!
@IBAction func iwantwaterbtn(_ sender: Any)
{
phrase1.voice = AVSpeechSynthesisVoice(language: "te_IN")
speakTalk.speak(phrase1)
}
}
Error picture
泰卢固语是印度语言。该代码适用于印地语,但不适用于泰卢固语。
最佳答案
您可以通过将其设置为AVSpeechSynthesisVoice(language: "te")
进行尝试。我尚未为此进行演示,但是我可以使用下面的链接找到它-Link
从此链接搜索所需的语言。此外,在使用前,请确保检查是否已将其下载到设备中。
关于swift - 尝试使IOS应用说泰卢固语。没有语音输出。但是,它适用于其他语言,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59548527/