Cleanup speech synth implementation. Correct recognizer.

This commit is contained in:
Gregory John Casamento 2020-02-06 03:15:18 -05:00
parent a9bc3fe5d9
commit 8320300fdd
5 changed files with 69 additions and 39 deletions

View file

@ -48,11 +48,13 @@ static GSSpeechRecognitionServer *sharedInstance;
- (void) startListening
{
// abstract nothing to do...
[_engine startListening];
}
- (void) stopListening
{
// abstract nothing to do...
[_engine stopListening];
}
- (void) setDelegate: (id<NSSpeechRecognizerDelegate>)delegate

View file

@ -1,8 +1,5 @@
#import "GSSpeechRecognitionServer.h"
#import <AppKit/NSSpeechRecognizer.h>
@interface GSSpeechRecognizer : NSSpeechRecognizer {
}
- (id)init;
@interface GSSpeechRecognizer : NSSpeechRecognizer
@end

View file

@ -11,6 +11,12 @@ static int clients;
+ (void)initialize
{
server = [[GSSpeechRecognitionServer sharedServer] retain];
if (server != nil)
{
clients++;
}
[[NSNotificationCenter defaultCenter]
addObserver: self
selector: @selector(connectionDied:)
@ -70,4 +76,20 @@ static int clients;
[super dealloc];
}
- (void) startListening
{
if (server != nil)
{
[server startListening];
}
}
- (void) stopListening
{
if (server != nil)
{
[server stopListening];
}
}
@end