何时设置 kAudioUnitProperty_StreamFormat?

发布于 2024-09-29 02:03:49 字数 164 浏览 0 评论 0原文

何时设置kAudioUnitProperty_StreamFormat(以及kAudioUnitProperty_SampleRate)?对于我的 AUGraph 中的每个 AU?或者只为 AU Mixer 设置就足够了?

安德烈

When to set kAudioUnitProperty_StreamFormat (and kAudioUnitProperty_SampleRate too)? For each AU in my AUGraph ? Or is it enough to set it jus for the AU Mixer ?

André

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

岁月无声 2024-10-06 02:03:49

您可以将其设置在每个音频单元的输入和输出上。

iPhone 只允许输入有符号整数。所以不要为浮动而烦恼,它是行不通的。

设置采样率

您使用CAStreamBasicDescription myDescription

; myDescription.mSampleRate = 44100.0f; //并对其他选项(例如mBitsPerChannel等)执行此操作。

在混音器等音频单元的输出上,它以8.24定点格式显示。

当您尝试创建回调并使用 audiounitrender 函数时请注意这一点,格式必须匹配并且您无法更改输出格式。 (但您可能仍然需要设置它)

使用 printf("Mixer 文件格式:"); myDescription.Print();获取格式描述。这取决于您将其放在初始化过程中的位置。

you set it on the inputs and outputs of each audiounit.

iphone only allows input signed ints. so don't bother with floats it just won't work.

you set the sample rates using

CAStreamBasicDesciption myDescription;

myDescription.mSampleRate = 44100.0f; // and do this for the other options such as mBitsPerChannel etc.

On the output of audiounits such as the mixer, it comes out as 8.24 fixed point format.

be aware of this when you're trying to create callbacks and using the audiounitrender function, the formats have to match and you can't change the output formats. (but you may still need to set it)

use printf("Mixer file format: "); myDescription.Print(); to get the format description. It will depend on where you put it in your initialization process.

老子叫无熙 2024-10-06 02:03:49

简而言之,是的 - 有关您实际需要在每个单元上设置的更多详细信息,请参阅 iOS 音频单元托管指南

In short, yes - for more detail on what you actually need to set on each unit, see Audio Unit Hosting Guide for iOS

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文