1、描述音频单元
AudioComponentDescription desc;
desc.componentType = kAudioUnitType_Output;
desc.componentSubType = kAudioUnitSubType_RemoteIO;
desc.componentFlags = 0;
desc.componentFlagsMask = 0;
desc.componentManufacturer = kAudioUnitManufacturer_Apple;
2、查找音频单元
AudioComponent inputComponent = AudioComponentFindNext(NULL, &desc);
3、获取音频单元实例
status = AudioComponentInstanceNew(inputComponent, &audioUnit);
4、启用录制功能、启用播放功能
UInt32 flag = 1;
status = AudioUnitSetProperty(audioUnit,
kAudioOutputUnitProperty_EnableIO,
kAudioUnitScope_Input,
kInputBus,
&flag,