 mishapetty
|
When I insert @” Hello me” into the syntax directly I get Flite to read the text.
But when I use a string variable Flite says nothing. I get no error message. Why is this?
|
 Halle
|
What do you see when you log the contents of the string variable at the time that you pass it to Flite? The odds are pretty great that the string has just autoreleased by the time it is passed to Flite, because as far as FliteController’s concerned there’s no real difference between text that is somehow dynamically assigned to an NSString and an NSString with fixed content.
|
 mishapetty
|
When I do NSLog on the variable I see Hello me. I don’t think it is autoreleasing…
Other suggestions?
|
 Halle
|
Can I ask you to clarify what you mean by variable? It sounds unusual to me because you would ostensibly have some initialized NSString object and at some point it would be assigned a value, either programmatically or at initialization time, with really no difference between those two things. Referring to it as a variable rather than an object with whatever value makes me wonder if there is something nonstandard about your code. Would you like to show the code where you initialize the NSString, something is assigned to it, you log it, and then you pass it to the FliteController method?
|
 mishapetty
|
NSString* BookPath = @”/Users/mishapetty/Desktop/ReadOutLoud3/test.txt”;
NSString* book = [NSString stringWithContentsOfFile:BookPath encoding: NSASCIIStringEncoding error:nil];
NSLog(@”%@”,book);
reading=[[FliteController alloc] init];
[reading say:book withVoice:@"cmu_us_rms8k"];
Here you go…
|
 Halle
|
Try it with NSUTF8StringEncoding if you are reading in text contents.
|