diff options
| author | Christian Cleberg <[email protected]> | 2026-03-14 09:56:39 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-03-14 09:56:39 -0500 |
| commit | c53a320698c17d98477c0384f1f644da9735f645 (patch) | |
| tree | 9c59fa0a2b2840d4531c562e79a89ed526096874 /DayByDay/DayByDayApp.swift | |
| parent | 8e4dea12423d7de762d665d58ab31abb1fe1d4f0 (diff) | |
| download | daybyday-c53a320698c17d98477c0384f1f644da9735f645.tar.gz daybyday-c53a320698c17d98477c0384f1f644da9735f645.tar.bz2 daybyday-c53a320698c17d98477c0384f1f644da9735f645.zip | |
implement more learning categories
Diffstat (limited to 'DayByDay/DayByDayApp.swift')
| -rw-r--r-- | DayByDay/DayByDayApp.swift | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/DayByDay/DayByDayApp.swift b/DayByDay/DayByDayApp.swift index 2cce4db..860d747 100644 --- a/DayByDay/DayByDayApp.swift +++ b/DayByDay/DayByDayApp.swift @@ -5,10 +5,27 @@ // Created by cmc on 2026-03-09. // +import AVFoundation import SwiftUI @main struct DayByDayApp: App { + init() { + Task.detached(priority: .background) { + // Activate the audio session early so the first real tap doesn't block. + try? AVAudioSession.sharedInstance().setCategory(.playback, mode: .default) + try? AVAudioSession.sharedInstance().setActive(true) + + // Force singleton init (voice selection) and prime the TTS engine + // with a silent utterance so subsequent speaks are instant. + await MainActor.run { + let warmup = AVSpeechUtterance(string: "") + warmup.volume = 0 + SpeechSynthesizer.shared.speakUtterance(warmup) + } + } + } + var body: some Scene { WindowGroup { ContentView() |
