Commit fb706bcc authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

NSSpeech: do not silently call objectAtIndexedSubscript and objectForKeyedSubscript

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <>
parent b755f699
......@@ -139,14 +139,14 @@ static int RenderText(filter_t *p_filter,
NSRange range = NSMakeRange(0, 2);
for (NSUInteger i = 0; i < count; i++) {
NSDictionary *voiceAttributes = [NSSpeechSynthesizer attributesForVoice:voices[i]];
NSString *voiceLanguage = voiceAttributes[@"VoiceLanguage"];
NSDictionary *voiceAttributes = [NSSpeechSynthesizer attributesForVoice: [voices objectAtIndex:i]];
NSString *voiceLanguage = [voiceAttributes objectForKey:@"VoiceLanguage"];
if ([p_sys->currentLocale isEqualToString:[voiceLanguage substringWithRange:range]]) {
NSString *voiceName = voiceAttributes[@"VoiceName"];
NSString *voiceName = [voiceAttributes objectForKey:@"VoiceName"];
msg_Dbg(p_filter, "switched to voice '%s'", [voiceName UTF8String]);
if ([voiceName isEqualToString:@"Agnes"] || [voiceName isEqualToString:@"Albert"])
[p_sys->speechSynthesizer setVoice:voices[i]];
[p_sys->speechSynthesizer setVoice: [voices objectAtIndex:i]];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment