0

I am trying connect kAudioUnitSubType_AUiPodEQ & kAudioUnitSubType_NBandEQ in a graph. But AUGraphInitialize always fails with error -10868.

The graphs has

FilePlayerNode->iPodEqNode->bandEqNode->outPutNode.

I tried

FilePlayerNode->bandEqNode->iPodEqNode->outPutNode.

& added a converter node

FilePlayerNode->iPodEqNode->converterNode->bandEqNode->outPutNode.

Is it possible to do this (connecting two effect nodes in a graph)?

Clement Prem
  • 3,112
  • 2
  • 23
  • 43

1 Answers1

0

I added a converter unit between ipodEQ & band Eq, it is working.

Just adding the code for reference

  AUNode converterNode;
    AudioUnit convertrunit = nullptr;
    {
    AudioComponentDescription convertUnitDescription;
    convertUnitDescription.componentManufacturer  = kAudioUnitManufacturer_Apple;
    convertUnitDescription.componentType          = kAudioUnitType_FormatConverter;
    convertUnitDescription.componentSubType       = kAudioUnitSubType_AUConverter;
    convertUnitDescription.componentFlags         = 0;
    convertUnitDescription.componentFlagsMask     = 0;
    AUGraphAddNode (player->graph, &convertUnitDescription, &converterNode);
    }
 {

AudioStreamBasicDescription eqAsbd;

UInt32 streamFormatSize = sizeof(eqAsbd);

AudioUnitGetProperty(player->eqUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 0, &eqAsbd, &streamFormatSize);

AudioUnitSetProperty(convertrunit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &eqAsbd, streamFormatSize);

AudioStreamBasicDescription bandAsbd;

UInt32 bandstreamFormatSize = sizeof(bandAsbd);

AudioUnitGetProperty(player->bandEQUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &bandAsbd, &bandstreamFormatSize);

AudioUnitSetProperty(convertrunit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 0, &bandAsbd, bandstreamFormatSize);

}

Nodes in graph

FilePlayerNode->mixerNode-> iPodEqNode->converterNode->bandEqNode->outPutNode.

Update The issue was

For some reason, some AU nodes take a stream format in float by default, while others take it in integers. If the stream formats don't match, you get this error.

Thanks @Guy https://stackoverflow.com/a/11133194/1292441

Community
  • 1
  • 1
Clement Prem
  • 3,112
  • 2
  • 23
  • 43