1
var mixerUnitDescription = AudioComponentDescription()
 mixerUnitDescription.componentType = kAudioUnitType_Mixer;
 mixerUnitDescription.componentSubType = kAudioUnitSubType_MatrixMixer;
 mixerUnitDescription.componentManufacturer = kAudioUnitManufacturer_Apple;
 mixerUnitDescription.componentFlags = 0;
 mixerUnitDescription.componentFlagsMask = 0;
 
 AVAudioUnit.instantiate(with: mixerUnitDescription) { [self] mixerUnit, error in
 var status = AudioUnitSetParameter(avAudioUnit!.audioUnit, kMatrixMixerParam_Volume, kAudioUnitScope_Global, 0xFFFFFFFF, 1.0, 0)
 
 var numInputBuses:UInt32 = 2
 var numOutputBuses:UInt32 = 1
 // Input bus config
 status = AudioUnitSetProperty(avAudioUnit!.audioUnit,
 AudioUnitPropertyID(kAudioUnitProperty_ElementCount),
 AudioUnitScope(kAudioUnitScope_Input),
 0,
 &numInputBuses,
 UInt32(MemoryLayout<UInt32>.size))
 }

When I set the volume, I get the error -10867 kAudioUnitErr_Uninitialized. However, I can successfully set the number of input and output bus. Why is that?

asked Feb 14, 2025 at 3:05
1
  • 1
    The question title mentions an AVAudioEngine but there's no sign of one in your question. Can you show how you're configuring the engine? AVAudioEngine will eventually initialize your mixer, at which point you should be able to set volumes. Maybe it will initialize if you call prepare. Anyhow, show more code. Commented Feb 14, 2025 at 8:45

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.