1

I'm working on an audio debug feature and trying to get the AudioUnit.AudioUnitPropertyIDType.Latency property value of my audio unit using Xamarin.iOS. Unfortunately I don't see related method to retrieve the value property value like audioUnit.GetParameter.

Though I can see and successfully set properties using audioUnit.SetParameter method.

Did I miss something?

Mando
  • 11,414
  • 17
  • 86
  • 167

1 Answers1

1

Not an answer but AudioUnit has private AudioUnitSetProperty method which is exposed as SetAudioFormat, SetCurrentDevice and a number of other methods, but not for Latency. Looks like it wasn't implemented by Xamarin. But you always can use reflection ;)

public void SetAudioFormat(AudioStreamBasicDescription audioFormat, AudioUnitScopeType scope, uint audioUnitElement = 0U)
{
  int k = AudioUnit.AudioUnitSetProperty(this.handle, AudioUnitPropertyIDType.StreamFormat, scope, audioUnitElement, ref audioFormat, (uint) Marshal.SizeOf<AudioStreamBasicDescription>(audioFormat));
  if (k != 0)
    throw new AudioUnitException(k);
}
Artur Shamsutdinov
  • 3,127
  • 3
  • 21
  • 39