OGeek|极客世界-中国程序员成长平台

标题: ios - 更改 AVAudioNode 的输出格式 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 12:14
标题: ios - 更改 AVAudioNode 的输出格式

我正在尝试更改 AVAudioMixerNode 的输出格式,以便它以较低的采样率而不是默认格式输出单声道音频。我是否必须继承 AVAudioMixerNode 类并重写 outputFormatForBus 函数才能做到这一点,还是有其他方法?



Best Answer-推荐答案


查看 AVAudioEngine 的文档对于这种方法:

- (void)connectAVAudioNode *)node1 
             toAVAudioNode *)node2
         formatAVAudioFormat *)format

注意格式参数:

If not NULL, the format of the source audio node’s output bus is set to this AVAudioFormat object. In all cases, the format of the destination audio node’s input bus is set to match that of the source audio node’s output bus.

AVAudioMixerNode 输出总线连接时指定单声道、低采样率 AVAudioFormat

关于ios - 更改 AVAudioNode 的输出格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34068617/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4