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

标签 swift text-to-speech avspeechsynthesizer avspeechutterance

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/

相关文章:

javascript - JS/JQuery 文本转语音 : How to chain audios?

ios - 在 didReceiveRemoteNotification 中播放声音,同时在后台使用文本到语音功能

ios - AVspeechSynthesizer iOS 文本语音

ios - 每次应用程序打开时运行代码 - 更好的方法?

ios - swift 核心数据从一对多关系中获取对象

cocoa-touch - iOS 上的文字转语音

java - 共享偏好编辑器混合值

ios - AVSpeechSynthesizer错误: An AVSpeechUtterance shall not be enqueued twice

ios - 关联类型为类的协议(protocol)的扩展?

ios - 我的用户默认设置不保存我的 slider 值 - Swift 3