Archive for August, 2009

Talking to the Cloud, and the Cloud Talking Back

Friday, August 28th, 2009

One of the great things about Tropo is that it has a speech recognition and text to speech engine built right in. This allows a user to speak commands to your voice application and respond to them with dynamically generated content. We make every effort to make these features robust and yet simple to use for developers.

In the first case, we will ask the user to provide their zipcode and then play it back to them:

  answer
  options = { 'choices'     => '[5 DIGITS]',
              'repeat'      => 3,
              'onBadChoice' => lambda { say 'That is not a zip code, please try again.'} }
  choice = ask 'Please enter your zip code.', options

  # Add spaces to speak back individual digits, rather than one number
  zipcode = String.new
  choice.value.split(//).each { |char| zipcode << char + ' ' }
  say "Your zip code is #{zipcode}. Goodbye."

The key to this is the option ‘choices’, which is where we may pass our simple grammar to prompt the user. In this case we are asking the speech recognition engine to ask for up to [5 DIGITS] and the user may then either use their phone’s touch tone keypad or speak their response. We then take that response, which comes back as a string, and add spaces in between the numbers so that it is spoken back as you would a zipcode as opposed to a single number.

Now that is for digits, of course one may always use their telephone to enter digits you say. Now lets look at asking our customer questions:

  answer
  options = { 'choices'     => 'cheese, pepperoni, vegetarian',
              'repeat'      => 3,
              'onChoice'    => lambda { |choice| say "We will send you a #{choice.value}
                                                      pizza. Goodbye." },

              'onBadChoice' => lambda { say 'We do not have that kind of pizza,
                                             please try again.'} }
  choice = ask 'Which pizza would you like to order?', options

In this case we are passing the ‘choices’ option a string that provides multiple spoken choices that the user may speak to have a valid response. We are then playing that response back to the user when we recognize it as the value is populated in ‘choices.value’.

That was for simple multiple choice, what if more than one phrase may qualify for a single response?:

  answer
  options = { 'choices'     => 'denver broncos(broncos, denver, denver broncos),
                                dallas cowboys(cowboys, dallas, dallas cowboys)',
              'repeat'      => 3,
              'onChoice'    => lambda { |choice| say "A so you like the #{choice.value}
                                                      do you?. Goodbye." },
              'onBadChoice' => lambda { say 'We do not have that team, please try again.'} }
  choice = ask 'Who is your favorite football team?', options

First off, I am not making any statements about NFL teams here, just shortening the choices for the purposes of brevity.  In this case we are passing the ‘choices’ option a string that contains the responses we expect (ie – denver broncos) with a series of possible spoken phrases inside the parenthesis that could qualify. When one of those phrases is recognized, the qualifying value gets populated in the ‘choices.value’.

So what are you waiting for? Start talking with your users. There are many more examples in multiple languages may be found here.

Messaging with Tropo

Thursday, August 27th, 2009

After our announcement for support of SMS and Instant Messaging at SpeechTek this week, I would like to build upon Mike Thompson’s post for building Messaging into your Tropo applications. To get started all you need is the same Tropo account you are already using.

When you log in to your account now, you will notice three additional features:

1. An option to add a URL that powers SMS/messaging

TropoMessagingURL

2. An option to add an SMS enabled number (provided we have them in stock)

TropoMessagingSMS

3. An option to add one or more Instant Messaging Networks to your application

TropoMessagingIMNets

Once you have created a new application, now you need to write a script. The beauty is that you use the same methods and capabilities of the existing Tropo API. In this Ruby example (available on Gist) we are going to play a sandwich trivia game, where we ask the user to tell us what WE think are the best sandwiches ever:

TropoMessagingScript

When you then chat with the Instant Messaging or SMS account you have configured in your application, you will see something like this:

TropoMessagingExample

Thats it! You have added messaging to your Tropo account.

A current consideration is that when dealing with different channels your timeouts need to be adjusted. On a voice call you may not want to wait for a response any more than 10 seconds, while with messaging you may want to wait 30 seconds or 60 seconds or more. This is why we have two URLs, one for voice and one for SMS/messaging right now, to allow you to account for user behavior across different channels.

Stay tuned as we add additional features to Tropo, and enjoy!

Tropo Adds Transcription for Recordings

Wednesday, August 26th, 2009

We have been busy adding additional features to Tropo with more to come. Today we are making available the ability to transcribe recorded audio and have the results posted to you via email or an HTTP POST. In addition to this, we have also created an option that allows you to send the recorded audio file out of the Tropo cloud directly to your servers via FTP or an HTTP POST. Now you may have easy access to recordings and what is being said!

To take advantage of this all you need to do is add a few extra options to your record method. Here is a Ruby example:

answer
say 'Welcome to ruby recording test'

event = record('Say something after the beep.',
{ :repeat              => 0,
:bargein             => true,
:beep                => true,
:silenceTimeout      => 2,
:maxTime             => 30,
:timeout             => 4.03456789,
:recordURI           => 'http://tropo.to-a-domain.com/post_audio?filename=file123456.wav',
:transcriptionOutURI => 'http://tropo.to-a-domain.com/receive_transcription',
:transcriptionID     => '123456' })

log 'Recorded file: ' + event.recordURI
say 'Thanks for your testing ruby on Tropo platform'
hangup

(Link)

Don’t forget that these new options are available in any of the languages supported by Tropo. So do not hesitate to add this to your Groovy, Javascript, PHP, Perl or Ruby scripts today!

We have more to come shortly, so stay tuned for additional features and helper apps to take advantage of these new features.

Add SMS and IM to any existing Tropo application in Ruby, python, PHP, JavaScript or Groovy… today!

Tuesday, August 25th, 2009

As part of our Prophecy 10 announcement today, you can now immediately start to add SMS and instant messaging to your existing (or new) Tropo applications. When you login to Tropo and look at the settings for one of your applications, you will see that you now have new settings:

troposmsim.jpg

All you need to do is follow the links and instructions and… ta da… you now have a single “communications app” that is communicating with users through voice, SMS, and IM. (And yes, you could of course create a “SMS-only” or “IM-only” app that purely interacts with users via those mediums.)

Please do check it out… try it out (perhaps with the sample apps available at docs.tropo.com)… and let us know what you think. And if you come up with a great sample app using the IM or SMS side of things, we’d love to hear about it and potentially point it out to others.

Technorati Tags: , , , , , , , ,

Slides available for Voxeo CTO RJ Auburn’s ClueCon talk: “Hey, man, can I get a clue?”

Tuesday, August 11th, 2009

Out at ClueCon 2009 last week in Chicago, Voxeo CTO RJ Auburn gave his talk “Hey, man, can I get a clue?” all about development of communications applications in general and Tropo.com in specific.

Like most of RJ’s presentations, he’s got lots of great slides and made it quite a fun and enjoyable preso. I recorded a video of the presentation which I’ll be working on getting up on our site soon. Meanwhile, take a look through his slides:

Technorati Tags: , , , , , , ,

Update to the Tropo FAQ Reveals More of our Java Underpinnings

Monday, August 3rd, 2009

We know it is important to provide developers as much information as possible in order to allow them to maximize their use of Tropo. To this end we have updated the Tropo FAQ, revealing more about the Java underpinnings of Tropo. If you have any questions, do not hesitate to come by and chat with us on the IRC (#tropo), Public Skype Chat or the Tropo Forums.