gpt4 book ai didi

ios - AVSpeechSynthesis 结束

转载 作者:行者123 更新时间:2023-11-28 22:00:27 25 4
gpt4 key购买 nike

您好,我正在使用 AVSpeechSynthesizer 和 AVSpeechUtterance 构建一个 iOS 7 应用程序,我想弄清楚合成何时完成。更具体地说,我想在合成结束时更改播放/暂停按钮的外观。有人可以帮我理解在合成结束时是否调用了某种方法?提前致谢

最佳答案

设置AVSpeechSynthesizerdelegate属性并实现如下委托(delegate)方法:

- (void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer didFinishSpeechUtterance:(AVSpeechUtterance *)utterance {
//do whatever you need to do
}

您可能还对 speechSynthesizer:didCancelSpeechUtterance: 委托(delegate)方法感兴趣,如果您以编程方式停止说话(例如,在按下按钮后)。

关于ios - AVSpeechSynthesis 结束,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25294893/

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