Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法对 AVSpeechSynthesizer 的声音应用过滤器或改变它的音高?或者甚至使用另一个用于 iOS 的 TTS API,我们可以改变它们的声音?或者我们可以在不播放的情况下录制TTS语音,然后在我们修改它的语音音高后播放它吗?
要使用语音合成器,您必须创建一个 AVSpeechUtterance 对象。话语允许您设置许多属性,包括音高。改变音高不会影响语速。使用示例:
let utterance = AVSpeechUtterance(string: textToSpeak.text!) utterance.pitchMultiplier = pitchValue utterance.rate = rate.value utterance.volume = volume.value utterance.voice = voice