【发布时间】:2014-04-16 05:28:39
【问题描述】:
我正在尝试重塑一个看起来像这样的AUGraph:
multichannel mixer -> remote I/O
变成这样:
callback -> converter1 -> bandpass -> reverb -> converter2 -> mixer(bus 0) -> remote I/O
在图表被初始化并启动之后(即“on the fly”)。为了允许流格式传播和音频单元协商每个连接的格式,我按以下顺序附加新创建的音频单元:
- 清除所有现有连接 (
AUGraphClearConnections())。 - 重建默认连接(
mixer->remote I/O) - 将
converter2附加到mixer,总线#0 (converter2 将其输出匹配到混音器:整数) - 将
reverb附加到converter2(converter1 将其输入匹配到混响:float) - 将
bandpass附加到reverb(都使用浮点数) - 将
converter1附加到bandpass(converter1 应该匹配其输出到带通:float)
(之前使用AudioUnitSetProperty手动将转换器1的输入设置为整数)
...最后,将渲染回调连接到转换器#1 的输入。
我检查了所有 Core Audio 函数的返回值(错误代码)。另外,连接好每个节点后,我在图上分别调用AUGraphUpdate()和CAShow()。
最后一步(“5. 将转换器 #1 连接到带通效果”)失败,代码为 -10868 (kAudioUnitErr_FormatNotSupported)。
这是CAShow() 在对AUGraphUpdate() 的违规调用之前的输出:
AudioUnitGraph 0x305A000:
Member Nodes:
node 1: 'aumx' 'mcmx' 'appl', instance 0x17822d0e0 O I
node 2: 'auou' 'rioc' 'appl', instance 0x17822cd80 O I
node 3: 'aufc' 'conv' 'appl', instance 0x170833e40 O
node 4: 'aufx' 'bpas' 'appl', instance 0x170827b60 O I
node 5: 'aufx' 'rvb2' 'appl', instance 0x170835100 O I
node 6: 'aufc' 'conv' 'appl', instance 0x170a21460 O I
Connections:
node 1 bus 0 => node 2 bus 0 [ 2 ch, 44100 Hz, 'lpcm' (0x00000C2C) 8.24-bit little-endian signed integer, deinterleaved]
node 6 bus 0 => node 1 bus 0 [ 2 ch, 44100 Hz, 'lpcm' (0x00000C2C) 8.24-bit little-endian signed integer, deinterleaved]
node 5 bus 0 => node 6 bus 0 [ 2 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
node 4 bus 0 => node 5 bus 0 [ 2 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
CurrentState:
mLastUpdateError=0, eventsToProcess=F, isInitialized=T, isRunning=T (1)
那么,发生了什么事?
注意最后一次调用AUGraphConnectNodeInput() 本身返回noErr;之后的图形更新会引发错误。
【问题讨论】:
标签: ios core-audio audiounit