使用 iOS 3d 混合器
我的 AUGraph 设置相当简单,将多通道混音器连接到 I/O 单元。通过回调函数访问播放,一切正常。
我正在尝试切换到 3D 混音器而不是多通道混音器。因此,我将参数从 kAudioUnitSubType_MultiChannelMixer 切换为 kAudioUnitSubType_AU3DMixerEmbedded 并保留所有其他设置相同。
结果是一种高音调的呜呜声,听起来像是什么东西,然后就变成了呜呜声。我已经检查了每个 3D 混音器单元的 参数 并将它们设置为默认值,但是没有任何变化。不过,打开和关闭 k3DMixerParam_Enable 参数确实可以使播放静音和取消静音。
我可能错过了什么设置?或者知道在哪里可以找到可用的 3d 混合器的示例?
I have a AUGraph setup fairly simply with a multichannel mixer connected to an I/O unit. The playback is accessed through a callback function and everything works nicely.
I am trying to switch over to the 3D Mixer instead of the Multichannel mixer. So I switched the parameter from kAudioUnitSubType_MultiChannelMixer to kAudioUnitSubType_AU3DMixerEmbedded and left all the other setup the same.
The result was sort of a high pitched whine that seemed to start sounding like something then became just whine-ish. I have gone through each of the 3D Mixer unit's parameters and set them to their defaults but there was no change. Flipping on and off the k3DMixerParam_Enable parameter did work at muting and unmuting the playback though.
What setup I might have missed? or know where to find an example of a working 3d Mixer?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
正如已经指出的,3d 混音器需要单声道输入。但您还必须使用 UInt16 作为输入示例数据类型。这是一个有效的 AudioStreamBasicDescription:
As already pointed out the 3d mixer needs mono inputs. But you also have to use UInt16 as the input sample data type. This is a working AudioStreamBasicDescription:
正如所有答案已经提到的:iOS 上的 3D Mixer 需要单声道输入。
在 iOS 8 / Xcode 6 上,规范格式的概念已被弃用,我发现这个(并且只有这个)单声道流格式描述用作 3D 混合器输入总线流格式描述:
应该设置采样率,然后从
AVAudioSession
。在连接到 3D 混合器输入的音频单元的输出上设置此格式。这可能是一个 AUConverter 单元...
但是请注意,这尚未经过测试 << iOS 8。
As all answers already mention: the 3D Mixer on iOS needs mono inputs.
On iOS 8 / Xcode 6, the concept of canonical formats is deprecated and I found this (and only this) mono stream format description working as 3D Mixer input bus stream format description:
The sample rate should be set and then obtained from the
AVAudioSession
.Set this format on the output of the Audio Unit connected to the 3D Mixer input. Which is probably a AUConverter Unit...
Note however, this hasn't been tested for < iOS 8.
3d 混音器需要单声道输入。
http://lists.apple.com/archives/coreaudio-api /2010/Sep/msg00144.html
The 3d Mixer needed mono inputs.
http://lists.apple.com/archives/coreaudio-api/2010/Sep/msg00144.html