[ObjectiveC] Text to Speech with Google Translate

Today, an easy way to use google translate as Text to Speech service.

Do you know this one?
http://www.translate.google.com/translate_tts?tl=it&q=ciao,%20come%20stai?

I wrote a class to do this in easy way.

[code lang=”java” autolinks=”false” collapse=”false” firstline=”1″ gutter=”true” htmlscript=”false” light=”false” padlinenumbers=”false” smarttabs=”true” tabsize=”4″ toolbar=”false”]APSpeech *Speech = [[APSpeech alloc] init];

Speech.Volume = 0.5;  // optional, default 0.4
Speech.Loop   = 0;    // optional, default 0

[Speech SpeechThis:@"Ciao, come stai?" inLanguage:APSpeechLanguageITA];

[Speech release];[/code]

You need only AVFoundation framework in your project.

Download source code here.

Rif: albertopasca.it

 

Alberto Pasca

Software engineer @ Pirelli & C. S.p.A. with a strong passion for mobile  development, security, and connected things.