0

Using Google TTS to developed in iPhone application, i have send a request in some words, then i get the audio data to play using AVAudioPlayer.

I have send a request as more words, then data comes as null. Google TTS supports only small kind of words to convert audio data or more, I want to know that so, please help me.

Thanks in Advance

I tried this:

NSString *linkTTS = [NSString stringWithFormat:@"http://translate.google.com/translate_tts?tl=en&q=I+am+new+to+IPhone+development+I+am+working+on+Audio+player+i+have+to+show+the+current+time+and+estimated+time"];
    NSData *dataTTS = [NSData dataWithContentsOfURL:[NSURL URLWithString:linkTTS]];
    NSLog(@"dataTTS:%@",dataTTS);
    _googlePlayer = [[AVAudioPlayer alloc] initWithData:dataTTS error:nil]; 
    [_googlePlayer play];
4

2 に答える 2

0

Google TTSは、短いテキスト(100文字未満)に対してのみ機能します。

したがって、テキストの長さに関連するテキストを手動で分割し、サブテキストをGoogleTTSに提供する必要があります。

于 2013-03-14T17:43:27.613 に答える
0

この問題にも直面しています。このリンクから助けを得ました (リンク ページの右側には 24.0 MB の (ダウンロード) ファイルが含まれています)。

[fliteEngine stopTalking];// テキストを再生したい場合は、コードでこの行をコメントしてください。

    [fliteEngine speakText:@"What ever you want to speech"];    // Make it talk
    [fliteEngine setPitch:100.0 variance:50.0 speed:1.0];   // Change the voice properties
    [fliteEngine setVoice:@"cmu_us_awb"];   // Switch to a different voice
    [fliteEngine stopTalking];// ignore the last line

ハッピーコーディング

于 2013-03-13T06:46:27.123 に答える