0

I have code to use a specific voice to speak my utterance

if language == "en-GB" {
                    utterance.voice = AVSpeechSynthesisVoice(identifier: "com.apple.ttsbundle.siri_female_en-GB_premium")
            }
            
            try? AVAudioSession.sharedInstance().setCategory(.playback, mode: .default)//.voicePrompt
            try? AVAudioSession.sharedInstance().setActive(true)
            utterance.rate = 0.51
            utterance.pitchMultiplier = 1.6
            utterance.postUtteranceDelay = 0.3

But the utterance always speaks the voice I have selected in my iphone by default…

How can I programatically force utterance voice to override the default voice selected in the device?

Nat Serrano
  • 472
  • 1
  • 4
  • 17

0 Answers0