English 中文(简体)
执行音频PlayerDidFinishPlaying:successful:in Flite发动机
原标题:implementing audioPlayerDidFinishPlaying:successfully: in Flite engine
  • 时间:2010-06-23 08:38:40
  •  标签:
  • iphone

我正在将Flinite文本用于我的项目

......

  SBJSON *json = [[SBJSON alloc]init];
fliteEngine = [[FliteTTS alloc] init];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.sampleurl.txt"]];
NSData *response = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
NSString *jsonstring = [[NSString alloc]initWithData:response encoding:NSUTF8StringEncoding];

NSArray *asanasList = [json objectWithString:jsonstring error:nil];
NSArray *asanas =[asanasList objectForKey:@"yogagurubackpain"];


for(NSDictionary *test in asanas)
{

    UrlValues *myasanas = [[UrlValues alloc]init];
    myasanas.asanatitle = [test objectForKey:@"asanatitle"];
    myasanas.asanatranscript = [test objectForKey:@"asanatranscript"];
    myasanas.asanapicture = [test objectForKey:@"asanapicture"];
    [data.yoga addObject:myasanas];
    [myasanas release];
}


UrlValues *asana=[[data yoga]objectAtIndex:0];
self.AsanaName.text = [asana asanatitle];
self.AsanaTranscript.text = [asana asanatranscript];

NSString *imageUrl = [asana asanapicture];
NSString* mapUrl = [imageUrl stringByReplacingPercentEscapesUsingEncoding:NSASCIIStringEncoding];
NSData* imageData = [[NSData alloc]initWithContentsOfURL:[NSURL URLWithString:mapUrl]];
UIImage* image = [[UIImage alloc] initWithData:imageData];
self.AsanaImage.image = image;


NSString *speak = self.AsanaTranscript.text;
[fliteEngine setVoice:@"cmu_us_rms"];
[fliteEngine speakText:speak];
[fliteEngine setPitch:100.0 variance:11.0 speed:0.4];
    [imageData release];
    [image release];

[jsonstring release];
[json release];

Plz帮助我掌握一些样本代码或辅导,以便我能够完成任务。

最佳回答
问题回答

暂无回答




相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签