AVSpeechSynthesizer输出为文件? [英] AVSpeechSynthesizer output as file?

查看:148
本文介绍了AVSpeechSynthesizer输出为文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

AVSpeechSynthesizer有一个相当简单的API,它不支持保存到内置的音频文件。

AVSpeechSynthesizer has a fairly simple API, which doesn't have support for saving to an audio file built-in.

我想知道是否有办法解决这个 - 可能会录制静音播放的输出,以便稍后播放?或更高效的东西。

I'm wondering if there's a way around this - perhaps recording the output as it's played silently, for playback later? Or something more efficient.

推荐答案

截至目前 AVSpeechSynthesizer 不支持这个 。无法使用 AVSpeechSynthesizer 获取音频文件。几个星期前我尝试过我的一个应用程序并发现它不可能,iOS 8中的 AVSpeechSynthesizer 也没有任何改变。

As of now AVSpeechSynthesizer does not support this . There in no way get the audio file using AVSpeechSynthesizer . I tried this few weeks ago for one of my apps and found out that it is not possible , Also nothing has changed for AVSpeechSynthesizer in iOS 8.

我也想过录制正在播放的声音,但是这种方法存在很多缺陷,例如用户可能正在使用耳机,系统声音可能低或静音,它可能会遇到其他声音外部声音,因此不宜采用这种方法。

I too thought of recording the sound as it is being played , but there are so many flaws with that approach like user might be using headphones, the system sound might be low or mute , it might catch other external sound, so its not advisable to go with that approach.

这篇关于AVSpeechSynthesizer输出为文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆