gpt4 book ai didi

ios - AVSpeechSynthesisVoice 未正确加载

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:14:13 25 4
gpt4 key购买 nike

我想在 iOS 上玩转语音,但我立即遇到了障碍。声音不想更改为不同的语言或口音。仅供引用,我正在运行 iOS 9 beta 3,也许它只是一个错误,但这是我的代码:

    let utter = AVSpeechUtterance(string: "hello and good morning")
let voice = AVSpeechSynthesisVoice(language: "en-au")
utter.voice = voice

if voice == nil {
print("bad voice")
}

let synth = AVSpeechSynthesizer()
synth.speakUtterance(utter)

它确实在控制台中给我这个错误:

AXAlternativeVoices was unable to retrieve custom voice assets. This could possibly be caused by someone requesting voices they are not entitled to. Error: Error Domain=ASError Code=15 "The operation couldn’t be completed. (ASError error 15 - Unable to copy asset information)" UserInfo=0x13e662970 {NSDescription=Unable to copy asset information}

有没有人有这个问题,我在网上找不到任何东西。谢谢。

最佳答案

尝试说“en-AU”,而不是“en-au”

关于ios - AVSpeechSynthesisVoice 未正确加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31362825/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com