iPadOS 14 beta 8: AVSpeechSynthesisVoice.speechVoices() returns voices with emtpy names

Simply I did this using xcode beta 6 for iPadOS 14 beta 8:
Code Block
let osVoices = AVSpeechSynthesisVoice.speechVoices()
for voice in osVoices {
    print("\(voice.language) \(voice.name) \(voice.identifier) \(voice.gender)")
}

And there are 54 voices, but only one has non-empty name, Alex, and all others have empty names (""), though part of voice.identifier contains name.

Is this a bug or am I missing something?
This seems broken on the GA as well. My app is broken. Has anyone found a solution?
The workaround im going with. Uppercase the piece of the identifier and remove any that start with siri_ and don't have readable names

Code Block
extension AVSpeechSynthesisVoice {
var hackName: String {
if !name.isEmpty {
return name
}
guard let start = identifier.range(of: ".", options: .backwards)?.upperBound else {
return name
}
let n = String(identifier[start...])
guard let end = n.range(of: "-", options: .backwards)?.lowerBound else {
return n
}
let x = String(n[n.startIndex...end]).replacingOccurrences(of: "-", with: "")
return String(x)
}
}


Then when I display a list of voices to the user I filter out any that start with "siri_"

If you go to settings -> Accessibility -> Voice Over -> Speech -> Voice. The names are populated after a brief delay.

From this point AVSpeechSynthesisVoice.speechVoices() returns a name as expected.

Seems like their is a callback happening?


iPadOS 14 beta 8: AVSpeechSynthesisVoice.speechVoices() returns voices with emtpy names
 
 
Q