libs-gui/Tools/speech/GSSpeechServer.m
Gregory John Casamento 0e43459d49 * config.make.in: Change to include BUILD_SPEECH in output
* configure: Regenerated
	* configure.ac: Check for flite library and flite.h header.
	* Tools/GNUmakefile: Add ${BUILD_SPEECH} to subproject list.
	* Tools/say/GNUmakefile
	* Tools/say/say.m: Say utility
	* Tools/speech/FliteSpeechEngine.m: 
	* Tools/speech/GNUmakefile
	* Tools/speech/GSSpeechEngine.[hm]
	* Tools/speech/GSSpeechServer.[hm]
	* Tools/speech/GSSpeechSynthesizer.[hm]: Speech synthesis engine
	implementation using flite.
	* Tools/speech/main.m: main for the server application.
	Speech code by David Chisnall <theraven@sucs.org>
	Changes to makefiles and config by Gregory Casamento.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28430 72102866-910b-0410-8b05-ffd578937521
2009-08-02 00:33:19 +00:00

72 lines
1.3 KiB
Objective-C

#import "GSSpeechServer.h"
#import "GSSpeechEngine.h"
#import "GSSpeechSynthesizer.h"
#import <Foundation/Foundation.h>
static GSSpeechServer *sharedInstance;
@implementation GSSpeechServer
+ (void)initialize
{
sharedInstance = [self new];
}
+ (void)start
{
NSConnection *connection = [NSConnection defaultConnection];
[connection setRootObject: sharedInstance];
if (NO == [connection registerName: @"GSSpeechServer"])
{
return;
}
[[NSRunLoop currentRunLoop] run];
}
+ (id)sharedServer
{
return sharedInstance;
}
- (id)init
{
if (nil == (self = [super init])) { return nil; }
engine = [GSSpeechEngine defaultSpeechEngine];
if (nil == engine)
{
[self release];
return nil;
}
return self;
}
- (id)newSynthesizer
{
return [[GSSpeechSynthesizer new] autorelease];
}
- (BOOL)startSpeakingString: (NSString*)aString notifyWhenDone: (id)client
{
[engine stopSpeaking];
[engine startSpeaking: aString notifyWhenDone: client];
return YES;
}
- (void)stopSpeaking
{
[engine stopSpeaking];
}
- (BOOL)isSpeaking
{
return [engine isSpeaking];
}
- (NSArray*)voices
{
return [engine voices];
}
- (oneway void)setVoice: (NSString*)aVoice
{
[engine setVoice: aVoice];
}
- (NSString*)voice
{
return [engine voice];
}
- (NSString*)defaultVoice
{
return [engine defaultVoice];
}
@end