iOS: Get the voice identifier in spoken content programmatically

164 Views Asked by At

Is it possible to get the current voice identifier programmatically?

We know we can set the voice in iOS Setting -> Accessibility -> Spoken Content -> Voices -> Your Country -> someone's voice, people can download the voices they want in this page.

And I can get all speech voices using below methods:

NSArray *allVoices = [AVSpeechSynthesisVoice speechVoices];
for (AVSpeechSynthesisVoice *voice in allVoices) {
    NSLog(@"Voice Language: %@, Identifier: %@, Quality: %ld", voice.language, voice.identifier, (long)voice.quality);
}

But I can not know which one is being used currently, the [AVSpeechSynthesisVoice currentLanguageCode] only shows the code like "en-US", but I want to know the current voice identifier like "com.apple.ttsbundle.siri_Marie_fr-FR_compact", is there a way to get it?

0

There are 0 best solutions below