Default iOS builder to one input channel
Construct the iOS engine with one input channel by default so live input is available immediately and the In: stepper reads 1. Trade-off: iOS prompts for microphone access at the first Start even while input defaults to test loop. The permission-gated enableLiveInput() rebuild stays in place for any future input-less configuration. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user