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

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

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

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 for details. The message you quote says that it is possible for an NSString to be empty (in a semantic sense) but have positive l

Re: NSSpeechSynthesizer and empty strings

2008-06-26 Thread I. Savant
Actually, "if ([myString length] == 0)" is probably better, but just IMHO... :) 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 a

Re: NSSpeechSynthesizer and empty strings

2008-06-26 Thread Omar Qazi
On Jun 26, 2008, at 5:32 PM, Nick Zitzmann wrote: It is possible for an NSString to have zero length but not be empty. Huh. Didn't know that. I must have done that at least a million times just today. *Opens Xcode* Omar Qazi Hello, Galaxy! 1.310.294.1593 smime.p7s Description: S/M

Re: NSSpeechSynthesizer and empty strings

2008-06-26 Thread Nick Zitzmann
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

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 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 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 }