The fleet does not have the opportunity to tie up to find out what the word says. It uses text to create an audio file and simply plays it. You can create your own class for processing information transmitted by TextToSpeech. The class would split the string into separate words and then pass them on to flirt.
fliteTTS.m, talkText: , wav , AVPlayer wav . , , URL- wav ( ).
, , , .
, talkText:
-(NSString *)urlForSpeech:(NSString *)text
{
NSMutableString *cleanString;
cleanString = [NSMutableString stringWithString:@""];
if([text length] > 1)
{
int x = 0;
while (x < [text length])
{
unichar ch = [text characterAtIndex:x];
[cleanString appendFormat:@"%c", ch];
x++;
}
}
if(cleanString == nil)
{
cleanString = [NSMutableString stringWithString:@""];
}
sound = flite_text_to_wave([cleanString UTF8String], voice);
NSArray *filePaths = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES);
NSString *recordingDirectory = [filePaths objectAtIndex: 0];
NSString *tempFilePath = [NSString stringWithFormat: @"%@/%s", recordingDirectory, "temp.wav"];
char *path;
path = (char*)[tempFilePath UTF8String];
cst_wave_save_riff(sound, path);
return tempFilePath;
}
, AVPlayer , :
[textView select:self]
textView.selectedRange = aSelectedRange;
aSelectedRange - , .
AVPlayer, , Apple . , :
, .