Note that there are some explanatory texts on larger screens.

plurals
  1. POCore Audio: kAudioOutputUnitProperty_SetInputCallback on a non-remoteIO unit
    primarykey
    data
    text
    <p>I'm new to Core Audio so I might not see something obvious… My aim is to process previously recorded audio signals. However, those signals should be filtered first. I don't need to play any audio. I only need to record and process it.</p> <p>My graph looks like that: RemoteIO --> HighPassFilter --> callback (process audio)</p> <p>And I set it up like this:</p> <pre><code>LBAudioDetectiveGetDefaultFormat(&amp;detective-&gt;streamFormat); // Create new AUGraph OSStatus error = NewAUGraph(&amp;detective-&gt;graph); LBErrorCheck(error); // Initialize AUNodes AudioComponentDescription rioCD = {0}; rioCD.componentType = kAudioUnitType_Output; rioCD.componentSubType = kAudioUnitSubType_RemoteIO; rioCD.componentManufacturer = kAudioUnitManufacturer_Apple; AUNode rioNode; error = AUGraphAddNode(detective-&gt;graph, &amp;rioCD, &amp;rioNode); LBErrorCheck(error); AudioComponentDescription filterCD = {0}; filterCD.componentType = kAudioUnitType_Effect; filterCD.componentSubType = kAudioUnitSubType_HighPassFilter; filterCD.componentManufacturer = kAudioUnitManufacturer_Apple; AUNode filterNode; error = AUGraphAddNode(detective-&gt;graph, &amp;filterCD, &amp;filterNode); LBErrorCheck(error); // Open the graph so I can modify the AudioUnits error = AUGraphOpen(detective-&gt;graph); // Adapt rioUnit error = AUGraphNodeInfo(detective-&gt;graph, rioNode, NULL, &amp;detective-&gt;rioUnit); LBErrorCheck(error); UInt32 onFlag = 1; AudioUnitElement bus1 = 1; UInt32 propertySize = sizeof(UInt32); error = AudioUnitSetProperty(detective-&gt;rioUnit, kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Input, bus1, &amp;onFlag, propertySize); LBErrorCheck(error); propertySize = sizeof(AudioStreamBasicDescription); error = AudioUnitSetProperty(detective-&gt;rioUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, bus1, &amp;detective-&gt;streamFormat, propertySize); LBErrorCheck(error); // Adapt filterUnit error = AUGraphNodeInfo(detective-&gt;graph, filterNode, NULL, &amp;detective-&gt;filterUnit); LBErrorCheck(error); AURenderCallbackStruct callback = {0}; callback.inputProc = _LBAudioDetectiveFilterOutput; callback.inputProcRefCon = detective; propertySize = sizeof(AURenderCallbackStruct); error = AudioUnitSetProperty(detective-&gt;filterUnit, kAudioOutputUnitProperty_SetInputCallback, kAudioUnitScope_Global, 0, &amp;callback, propertySize); LBErrorCheck(error); // Connect the two units AudioUnitElement bus0 = 0; error = AUGraphConnectNodeInput(detective-&gt;graph, rioNode, bus1, filterNode, bus0); LBErrorCheck(error); AUGraphInitialize(detective-&gt;graph); </code></pre> <p>My code fails with the error -10879 when I try to set the callback. I'm assuming that the filter audio unit doesn't support this property. How am I supposed to get the recorded sound then? A second generic output unit isn't allowed as far as I know.</p> <p>Thanks for your help in advance</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload