0

Just a simple quick question, how do I can know about AudioUnit host application changes to sample rate?

My custom AUAudioUnit v3 subclass seems not to have any property to observe and AUHostMusicalContextBlock do not provide a sample rate inspection.

I need to react for sample rate changes in host application.

Thank you

Jan Kubny
  • 303
  • 1
  • 8

1 Answers1

0

I believe a safe place to do it is in allocateRenderResourcesAndReturnError. e.g.,

mySampleRate = self.outputBus.format.sampleRate;

This is where Apple's iOSFilterDemoApp does it

  • 2
    It seems this is not the answer. In Apple's AUv3Filter demo, `outputBus`'s `sampleRate`(44100) was set by and hard coded in the "Adapter". I'm still looking for a way to get the host's sample rate. – LShi Mar 07 '20 at 15:35
  • I would like to see this too, as I am unable to inspect when a sample rate of project changes – Jan Kubny Oct 18 '20 at 20:52