【发布时间】:2015-10-10 18:20:52
【问题描述】:
我正在尝试在 CoreAudio 中查找此 kAudioUnitType_MusicEffect 的所有子类型。 所有其他类型都有据可查,但这似乎根本没有。 有人可以说明 kAudioUnitType_MusicEffect 的所有子类型吗?
【问题讨论】:
标签: objective-c cocoa core-audio audiounit
我正在尝试在 CoreAudio 中查找此 kAudioUnitType_MusicEffect 的所有子类型。 所有其他类型都有据可查,但这似乎根本没有。 有人可以说明 kAudioUnitType_MusicEffect 的所有子类型吗?
【问题讨论】:
标签: objective-c cocoa core-audio audiounit
您可以通过匹配空白描述 (searchDesc) 来遍历所有组件。然后你就得到了那个组件的描述(desc)。所以在这里我过滤所有 kAudioUnitType_Effect 子类型并打印组件名称。 (kAudioUnitType_MusicEffect 什么也没给我)。
AudioComponentDescription searchDesc = { 0, 0, 0, 0, 0 };
AudioComponent comp = NULL;
while (true) {
comp = AudioComponentFindNext(comp, &searchDesc);
if (comp == NULL) break;
AudioComponentDescription desc;
if (AudioComponentGetDescription(comp, &desc)) continue;
if (desc.componentType == kAudioUnitType_Effect) {
CFStringRef stringRef = NULL;
AudioComponentCopyName(comp, &stringRef);
NSString *name = (__bridge_transfer NSString *)stringRef;
NSLog(@"component name %@ ",name);
}
}
我通过观看this 视频学会了这项技术。
【讨论】: