Ciao Orso Bruno,
ho fatto qualche tentativo ed ora funziona, in pratica devi dichiarare questa interfaccia:
@interface VSSpeechSynthesizer : NSObject
{
}
+ (id)availableLanguageCodes;
+ (BOOL)isSystemSpeaking;
- (id)startSpeakingString:(id)string;
- (id)startSpeakingString:(id)string toURL:(id)url;
- (id)startSpeakingString:(id)string toURL:(id)url withLanguageCode:(id)code;
- (float)rate; // default rate: 1
- (id)setRate:(float)rate;
- (float)pitch; // default pitch: 0.5
- (id)setPitch:(float)pitch;
- (float)volume; // default volume: 0.8
- (id)setVolume:(float)volume;
@end
e poi istanziare la classe con:
speech = [[NSClassFromString(@"VSSpeechSynthesizer") alloc] init];
[speech startSpeakingString:@"Hello Orso bruno, how are you"];