18 #include <AppKit/AppKit.h>
23 "title" :
"Speech Voice",
24 "description" :
"An identifier for a speech synthesizer voice.",
29 "VuoList_VuoSpeechVoice"
44 const char *valueAsString =
"";
45 if (json_object_get_type(js) == json_type_string)
46 valueAsString = json_object_get_string(js);
63 NSArray *voices = [NSSpeechSynthesizer availableVoices];
64 int voiceCount = [voices count];
67 for (
int i = 0; i < voiceCount; ++i)
69 NSDictionary *voiceAttributes = [NSSpeechSynthesizer attributesForVoice:[voices objectAtIndex:i]];
92 NSString *voiceName = [NSString stringWithUTF8String:value];
96 NSDictionary *voiceAttributes = [NSSpeechSynthesizer attributesForVoice:voiceName];
100 const char *actualVoiceName = [[voiceAttributes objectForKey:NSVoiceName] UTF8String];
101 if (!actualVoiceName)
104 return strdup(actualVoiceName);
107 return strdup(
"No voice");