/* NSSpeechSynthesizer.m This file is part of the mySTEP Library and is provided under the terms of the GNU Library General Public License. */ #import #import #import "NSAppKitPrivate.h" #import "NSSystemServer.h" NSString *NSVoiceIdentifier=@"Identifier"; NSString *NSVoiceName=@"Name"; NSString *NSVoiceAge=@"Age"; NSString *NSVoiceGender=@"Gender"; NSString *NSVoiceDemoText=@"DemoText"; NSString *NSVoiceLanguage=@"Language"; NSString *NSVoiceGenderNeuter=@"GenderNeuter"; NSString *NSVoiceGenderMale=@"GenderMale"; NSString *NSVoiceGenderFemale=@"GenderFemale"; @implementation NSSpeechSynthesizer + (NSDictionary *) attributesForVoice:(NSString *) voice; { return nil; } + (NSArray *) availableVoices; { return [NSArray arrayWithObject:[self defaultVoice]]; } + (NSString *) defaultVoice; { return @"default"; } + (BOOL) isAnyApplicationSpeaking; { return NO; } - (id) delegate; { return _delegate; } - (id) initWithVoice:(NSString *) voice; { if((self=[super init])) { _voice=[voice retain]; } return nil; } - (void) dealloc { [_voice release]; [super dealloc]; } - (id) copyWithZone:(NSZone *) z; { return [[NSSpeechSynthesizer alloc] initWithVoice:_voice]; } - (BOOL) isSpeaking; { return NO; } - (void) setDelegate:(id) delegate; { _delegate=delegate; } - (void) setUsesFeedbackWindow:(BOOL) flag; { _usesFeedbackWindow=flag; } - (BOOL) setVoice:(NSString *) voice; { ASSIGN(_voice, voice); return YES; } - (BOOL) startSpeakingString:(NSString *) text; { return [self startSpeakingString:text toURL:nil]; } - (BOOL) startSpeakingString:(NSString *) text toURL:(NSURL *) url; { // send message to voice server daemon NSLog(@"say [%@]: %@", _voice, text); // split into words and phonemes // and call appropriate delegate methods [_delegate speechSynthesizer:self didFinishSpeaking:YES]; return YES; } - (void) stopSpeaking; { } - (BOOL) usesFeedbackWindow; { return _usesFeedbackWindow; } - (NSString *) voice; { return _voice; } - (void) encodeWithCoder:(NSCoder *)aCoder // NSCoding protocol { // [super encodeWithCoder:aCoder]; if([aCoder allowsKeyedCoding]) { } else { } NIMP; } - (id) initWithCoder:(NSCoder *)aDecoder { if([aDecoder allowsKeyedCoding]) { } else { } return NIMP; } @end