Deutsch? French? Spanish? How To Use International Text-To-Speech (TTS) in Tropo Apps
April 1st, 2010 by Dan YorkLast week we announced that Tropo now included for free the ability to support Text-To-Speech in 8 languages. In this post, I want to show you how you can easily implement this in your Tropo app. First, though, if you want to hear the different voices, you can call these numbers now and try it out:
+1 (407) 374-9911
Skype: +990009369991430013
SIP: sip:9991430013@sip.tropo.com
iNum: +883510001805741
Here is what the JavaScript code looks like for that application (thanks to Voxeon Ron Blaisdell):
answer();
wait('500');
say("Hello world! This is a demonstration of the various voices & languages on Tropo.");
//English Female - Allison - en-us
say("1 2 3 4 5 this is Allison", { voice: 'allison' });
//Spanish Castillian Female - Carmen - es-es
say("1 2 3 4 5 this is Carmen", { voice: 'carmen' });
//French Female - Florence - fr-fr
say("1 2 3 4 5 this is Florence", { voice: 'florence' });
//English UK - Kate - en-uk
say("1 2 3 4 5 this is Kate", { voice: 'kate' });
//German Female - Katrin - de-de
say("1 2 3 4 5 this is Katrin", { voice: 'katrin' });
//Italian Female - Paola - it-it
say("1 2 3 4 5 this is Paola", { voice: 'paola' });
//Dutch Female - Saskia - nl-nl
say("1 2 3 4 5 this is Saskia", { voice: 'saskia' });
//American Spanish Female - Soledad - es-mx
say("1 2 3 4 5 this is Soledad", { voice: 'soledad' });
say("ta da");
hangup();
That’s literally all you need to do… add the { voice:'name' } parameter to the say function and there you go!
Now for those of you who don’t use JavaScript, the syntax is similar for the other languages.
Ruby:
say "J'aime les écureuils!", :voice => 'florence' say "1 2 3 4 5 this in Florence", :voice => 'florence'
Python:
say ("Guten Tag!", {'voice':'katrin'})
say ("1 2 3 4 5 this is Katrin", {'voice':'katrin'})
Groovy:
say( "Hola, como estas?", [ 'voice':"carmen" ]) say( "1 2 3 4 5 this is Carmen", [ 'voice':"carmen" ])
PHP:
<?php say ("J'aime les écureuils!", array('voice'=>'florence')); ?>
<?php say ("1 2 3 4 5, this is Florence", array('voice'=>'florence')); ?>
That’s it! Simple and easy…
Today we support these languages and currently only female voices, but you can expect to see us releasing support for even more languages as well as male voices in the weeks and months ahead. And if you have a project that needs a specific voice, please do email our support team and let them know what you need.
Related posts:
- International Male (Voices)
- Tropo Speaks your Language – 24 in all
- Simple tips for better text to speech
- Tropo Adds Twitter and goes International
- Want to play with building Twitter apps on Tropo? Here’s source code for 5 sample apps.
Tags: Groovy, international, JavaScript, languages, Python, Ruby
