import SwiftUI
import Observation
import AVFoundation

@Observable class ApplicationData {
   let synthesizer: AVSpeechSynthesizer
   
   static let shared: ApplicationData = ApplicationData()
   private init() {
      synthesizer = AVSpeechSynthesizer()
   }
   func say(text: String) {
      let utterance = AVSpeechUtterance(string: text)
      utterance.voice = AVSpeechSynthesisVoice(language: "en-US")
      synthesizer.speak(utterance)
   }
}