WhisperBackgroundFallback
Keeps a WhisperEngine off the GPU while the app is in the background.
iOS revokes GPU access from background apps: a Metal command buffer submitted after the app has entered the background fails with MTLCommandBufferErrorDomain / accessRevoked and aborts the process. This controller reloads the engine with ComputeBackend.CPU_ONLY (use_gpu = false, Accelerate / NEON only) when the app enters the background and restores the previous configuration when it returns to the foreground.
On iOS, wire it to UIApplication notifications with WhisperEngine.observeAppLifecycle(...) (iosMain); on other platforms call onEnterBackground / onEnterForeground from your own lifecycle callbacks.
Transitions are applied in order on scope through WhisperEngine.reinitialize (i.e. on the engine's own thread, after transcriptions already queued). Rapid background/foreground toggles are conflated to the latest state. When abortInFlightOnBackground is true (default), a GPU transcription that is executing when the app enters the background is aborted immediately (it fails with com.donfuldauer.kggml.core.InferenceCancelledException); transcriptions queued behind it still run before the switch, so cancel those too if they must not touch the GPU.
Parameters
receives failures of the reloads (the engine keeps its previous configuration on failure).