#import #include #include @interface SpeechDelegate : NSObject @end @implementation SpeechDelegate - (void)speechSynthesizer: (NSSpeechSynthesizer*)sender didFinishSpeaking: (BOOL)success { exit((int)success); } @end int main(int argc, char **argv) { [NSAutoreleasePool new]; NSMutableString *words = [NSMutableString string]; NSString *outFile = nil; NSString *voice = nil; NSString *inFile = nil; int ch; while ((ch = getopt(argc, argv, "o:v:f:")) != -1) { switch (ch) { case 'o': outFile = [NSString stringWithUTF8String: optarg]; break; case 'f': inFile = [NSString stringWithUTF8String: optarg]; break; case 'v': voice = [NSString stringWithUTF8String: optarg]; break; } } int i; for (i=optind ; i