【发布时间】:2017-09-16 05:23:56
【问题描述】:
我已将 amazon polly 快速集成到我的一个项目中,并要求它对多组文本字符串进行 TTS。当然,我正在使用下面的一组指令来播放声音:
builder.continueOnSuccessWith { (awsTask: AWSTask<NSURL>) ->
Any? in
// The result of getPresignedURL task is NSURL.
// Again, we ignore the errors in the example.
let url = awsTask.result!
// Try playing the data using the system AVAudioPlayer
self.audioPlayer.replaceCurrentItem(with: AVPlayerItem(url: url as URL))
self.audioPlayer.play()
return nil
}
在调试时,我发现 replaceCurrentItem 正在添加要播放的新项目并忽略以前的项目。我想就 polly 如何在其框架内处理此类多次调用提出一些建议。
任何帮助表示赞赏!谢谢
【问题讨论】:
标签: ios amazon-web-services swift4 amazon-polly