I read this from AudioManager:
val AudioManager.outputFramesPerBuffer: Int
get() = getProperty(PROPERTY_OUTPUT_FRAMES_PER_BUFFER)
?.asInt().takeUnless { it == 0 } ?: 256
val AudioManager.outputSampleRate: Int
get() = getProperty(PROPERTY_OUTPUT_SAMPLE_RATE)
?.asInt().takeUnless { it == 0 } ?: 44100
I pass this to an audio engine written in c++ using jni and it is used for various things and I need to know how likely is that "sample rate" or "frames per buffer" changes durng application runtime.
Looks like to me that if this ever changes after attaching of some usb audio interface or something like that, it could lead to runtime issues of engine, so I shell be sure it never changes or I have to know when it could and re-initialize engine with updated values.