• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How to...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: How to...
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Crash in heartbeat thread while progress indicator showing
  • Next by Date: Re: Exception on ^⌘D when AppKit tries to use Lookup on my custom view
  • Previous by thread: Re: Crash in heartbeat thread while progress indicator showing
  • Next by thread: Re: How to...
  • Index(es):
    • Date
    • Thread