【问题标题】:AVSpeechSynthesis endedAVS语音合成结束
【发布时间】:2014-08-14 04:19:57
【问题描述】:

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

【问题讨论】:

    标签: ios objective-c ios7 avspeechsynthesizer


    【解决方案1】:

    设置AVSpeechSynthesizerdelegate属性并实现以下委托方法:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-04
      • 2013-12-23
      • 2014-10-09
      • 1970-01-01
      • 2014-02-26
      相关资源
      最近更新 更多