Re: NSSpeechSynthesizer and empty strings

2008-07-07 Thread Sean McBride
On 6/26/08 11:30 PM, Michael Ash said: No; don't ever do that. It is possible for an NSString to have zero length but not be empty. This is backwards. You can have a string that is empty but has non-zero length, due to the characters it contains being semantically null. Neat. Could you give

Re: NSSpeechSynthesizer and empty strings

2008-06-28 Thread Jim Correia
On Jun 26, 2008, at 8:32 PM, Nick Zitzmann wrote: On Jun 26, 2008, at 6:16 PM, William Squires wrote: Actually, if ([myString length] == 0) is probably better, but just IMHO... :) No; don't ever do that. It is possible for an NSString to have zero length but not be empty. See

NSSpeechSynthesizer and empty strings

2008-06-26 Thread David Brennan
Hi, I have a cocoa app that is using NSSpeechSynthesizer to speak the contains of a NSString to a file. My problem is when it is passed an empty string, - (BOOL)isSpeaking returns true. So I don't know when it is finished. If NSSpeechSynthesizer has nothing to say, I want to create an audio file

Re: NSSpeechSynthesizer and empty strings

2008-06-26 Thread I. Savant
If NSSpeechSynthesizer has nothing to say, I want to create an audio file with 1 second of silence. Maybe I'm misunderstanding the problem, but how about ... if ([myString isEqualToString:@]) { // Record silence into file ... } else { // Send string to speech synthesizer }

Re: NSSpeechSynthesizer and empty strings

2008-06-26 Thread David Brennan
Hi, I have just come up with solution. I add a silence to the start of the string. Therefore NSSpeechSynthesizer will always have something to say. NSString *tempString = @[[inpt PHON]]%[[inpt TEXT]]; tempString = [tempString stringByAppendingString:[inputText string]]; Regards,

Re: NSSpeechSynthesizer and empty strings

2008-06-26 Thread William Squires
Actually, if ([myString length] == 0) is probably better, but just IMHO... :) On Jun 26, 2008, at 1:15 PM, I. Savant wrote: If NSSpeechSynthesizer has nothing to say, I want to create an audio file with 1 second of silence. Maybe I'm misunderstanding the problem, but how about ... if

Re: NSSpeechSynthesizer and empty strings

2008-06-26 Thread I. Savant
Actually, if ([myString length] == 0) is probably better, but just IMHO... :) http://www.cocoabuilder.com/archive/message/cocoa/2004/7/5/111029 for details. Nick beat me to it! ;-) I must say I've been slow on the draw (and largely uncommunicative) lately - a major deadline came and

Re: NSSpeechSynthesizer and empty strings

2008-06-26 Thread James Walker
Nick Zitzmann wrote: It is possible for an NSString to have zero length but not be empty. See http://www.cocoabuilder.com/archive/message/cocoa/2004/7/5/111029 for details. The message you quote says that it is possible for an NSString to be empty (in a semantic sense) but have positive

Re: NSSpeechSynthesizer and empty strings

2008-06-26 Thread Michael Ash
On Thu, Jun 26, 2008 at 8:32 PM, Nick Zitzmann [EMAIL PROTECTED] wrote: On Jun 26, 2008, at 6:16 PM, William Squires wrote: Actually, if ([myString length] == 0) is probably better, but just IMHO... :) No; don't ever do that. It is possible for an NSString to have zero length but not be