How to...
How to...
- Subject: How to...
- From: Charlie Dickman <email@hidden>
- Date: Thu, 09 Aug 2012 13:00:43 -0400
I am trying to get the unix say command to speak the text I am writing to a file using the following...
NSTask *ls = [[NSTask alloc] init];
NSFileHandle *stdIn = [NSFileHandle fileHandleForReadingAtPath: txtFilePath];
[ls setStandardInput: stdIn];
[ls setLaunchPath: @"/usr/bin/say"];
[ls launch];
[ls release];
My problem is that the command speaks the text in the file when the task is launched but not anything written to it subsequently. I know about NSSpeechSynthesizer and I have tried it but it doesn't work reliably (I think the NSSpeechSynthesizer has a memory leak and am in touch with the responsible Apple engineer via the speech list but in the meantime...). I have also looked into using an NSPipe but it doesn't seem to add anything.
I think what I want to do is execute the command
ls -f "file" | say
but I can't figure out how to do that. Can someone help me?
Charlie Dickman
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden