I have an array of string and I want to convert it to speech but the problem was it speak all the worlds at once and it isn't clear the array is speechToTextLabels
@objc func startSpeech()
{
for label in speechToTextLabels {
let utTerance = AVSpeechUtterance(string: label)
utTerance.voice = AVSpeechSynthesisVoice(language: "en-gb")
let synthesizer = AVSpeechSynthesizer()
DispatchQueue.main.asyncAfter(deadline: .now() + 5.0) {
synthesizer.speak(utTerance)
}
}
}
}