17 #ifndef NS_RETURNS_INNER_POINTER
18 #define NS_RETURNS_INNER_POINTER
20 #include <Cocoa/Cocoa.h>
25 "title" :
"Speech Voice",
26 "description" :
"An identifier for a speech synthesizer voice.",
31 "VuoList_VuoSpeechVoice"
46 const char *valueAsString =
"";
47 if (json_object_get_type(js) == json_type_string)
48 valueAsString = json_object_get_string(js);
65 NSArray *voices = [NSSpeechSynthesizer availableVoices];
66 int voiceCount = [voices count];
69 for (
int i = 0; i < voiceCount; ++i)
71 NSDictionary *voiceAttributes = [NSSpeechSynthesizer attributesForVoice:[voices objectAtIndex:i]];
94 NSString *voiceName = [NSString stringWithUTF8String:value];
98 NSDictionary *voiceAttributes = [NSSpeechSynthesizer attributesForVoice:voiceName];
102 const char *actualVoiceName = [[voiceAttributes objectForKey:NSVoiceName] UTF8String];
103 if (!actualVoiceName)
106 return strdup(actualVoiceName);
109 return strdup(
"No voice");