diff --git a/Demo/ShoeGazeBuilderiOS/ShoeGazeBuilderiOSAppModel.swift b/Demo/ShoeGazeBuilderiOS/ShoeGazeBuilderiOSAppModel.swift index 129ba3c..32c4fc3 100644 --- a/Demo/ShoeGazeBuilderiOS/ShoeGazeBuilderiOSAppModel.swift +++ b/Demo/ShoeGazeBuilderiOS/ShoeGazeBuilderiOSAppModel.swift @@ -24,11 +24,12 @@ final class ShoeGazeBuilderiOSAppModel { private static let blockSize: Int = 512 private static let outputChannels: Int = 2 - // Kept at 0: with input channels the iOS driver switches the session to `.playAndRecord` - // and enables the RemoteIO input element, which makes iOS prompt for microphone access at - // engine start even in test-loop mode. iOS live input needs a permission-gated engine - // rebuild (request mic → reconstruct the engine with an input channel) before it can be - // enabled here without that surprise prompt. + // Default to one input channel so live input is available immediately. The trade-off is + // that the iOS driver runs a `.playAndRecord` session with the RemoteIO input element + // enabled, so iOS prompts for microphone access at the first Start even while the input + // still defaults to `.testLoop`. (The permission-gated `enableLiveInput()` rebuild remains + // available for any future build that starts input-less.) + private static let inputChannels: Int = 1 private static let numAudioBuses: Int = 256 private static let seedPedalType: String = "Overdrive" @@ -55,7 +56,7 @@ final class ShoeGazeBuilderiOSAppModel { init() { ShoeGazeBuilderiOSAppModel.configureAudioSession() let built: (engine: SynthesisEngine, driver: iOSAudioDriver, shoeGaze: ShoeGaze) = - ShoeGazeBuilderiOSAppModel.buildEngine(inputChannels: 0) + ShoeGazeBuilderiOSAppModel.buildEngine(inputChannels: ShoeGazeBuilderiOSAppModel.inputChannels) self.engine = built.engine self.iosDriver = built.driver self.shoeGaze = built.shoeGaze