试图使IOS应用说泰卢固语。没有语音输出。但是,它适用于其他语言

问题描述 投票:-1回答:1
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

泰卢固语是印度语言。此代码适用于北印度语,但不适用于泰卢固语。

swift text-to-speech avspeechsynthesizer avspeechutterance
1个回答
0
投票

您可以通过将其设置为AVSpeechSynthesisVoice(language: "te")进行尝试。我尚未为此进行演示,但是我可以使用下面的链接找到此内容-Link

通过此链接搜索所需的语言。此外,在使用前,请确保检查是否已将其下载到设备中。

© www.soinside.com 2019 - 2024. All rights reserved.