gpt4 book ai didi

ios - 如何创建实现多个音频单元的 AUAudioUnit?

转载 作者:可可西里 更新时间:2023-11-01 05:42:55 26 4
gpt4 key购买 nike

在 Apple 的创建 AUAudio 单元的文档中(此处:https://developer.apple.com/documentation/audiotoolbox/auaudiounit/1387570-initwithcomponentdescription)他们声称

A single audio unit subclass may implement multiple audio units—for example, an effect that can also function as a generator, or a cluster of related effects.

我在网上找不到这方面的例子。理想情况下,如果您的答案/解决方案涉及使用 Swift 和 AVAudioEngine 会很好,但我很乐意接受任何让我朝着正确方向前进的答案。

提前致谢。

最佳答案

我在 GitHub 上发布了一些源代码到我的测试应用程序,它使用 AVAudioEngine、Swift 和 C 实例化了一个 AVAudioUnit 生成器子类对象:

https://github.com/hotpaw2/auv3test5

请注意 Apple recommends NOT using Swift在实时音频上下文中,因此我的源代码部分是用 C 语言编写的,在 Objective C 包装类中。

如果您使用 initWithComponentDescription:options:error: ,你可以传递一个选项来配置你的新音频单元子类对象来做任何事情(在选项上使用类似 switch 语句的东西)。

关于ios - 如何创建实现多个音频单元的 AUAudioUnit?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46761477/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com