首页 > 解决方案 > 是否可以使用 avspeechsynthesizer 保存音频?

问题描述

语音合成器

当我将文本转换为语音时。我想保存该音频文件,但我无法使用avspeechsynthesizer保存该音频。

标签: iosswiftaudioavspeechsynthesizer

解决方案


为了更深入地了解E.Coms注释,该文件提供了有关变量AVSpeechSynthesis.h的以下信息:outputChannels

指定用于合成语音的音频通道,如 AVAudioSession 的当前路由中的通道描述所述。

语音音频将被复制到每个指定的通道。

默认值为 nil,这意味着系统默认值。

@available(iOS 10.0, *)
open var outputChannels: [AVAudioSessionChannelDescription]?

推荐阅读