gpt4 book ai didi

ios - 使用 AVSpeechSynthesizer 更新 MPRemoteCommandCenter 和播放暂停

转载 作者:行者123 更新时间:2023-11-28 17:55:59 26 4
gpt4 key购买 nike

我目前正在使用 AVSpeechSynthesizer 进行文本转语音。用于播放的类别是 AVAudioSessionCategoryPlayback 并且 AVAudioSession 设置为 Active YES

播放开始时,[TTS] TTSPlaybackCreate 无法初始化 dynamics: -3000 Xcode 控制台。当我暂停播放时,我得到 [TTS] _BeginSpeaking: couldn't begin playback

我的主要问题是 MPRemoteCommandCenterTTS 停止时没有更新为暂停

对于停止功能,我正在使用此代码;

BOOL speechStopped =  [self.ttsSpeechSynthesizer stopSpeakingAtBoundary:AVSpeechBoundaryImmediate];
if(!speechStopped) {
[self.ttsSpeechSynthesizer stopSpeakingAtBoundary:AVSpeechBoundaryWord];
}

最佳答案

我将 Airplay 连接到 Airplay 站。

关于ios - 使用 AVSpeechSynthesizer 更新 MPRemoteCommandCenter 和播放暂停,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46769894/

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