Posted on by No comments yet

LinkedInGoogle+TwitterFacebook

In this post I’d like to tell you about the latest project I’ve been working on, which is built using the Tropo API. It’s an elaboration of the “Moveable” series of apps, which I have written about previously here. It’s also supercharged with some ideas lifted directly from Telephony Black Magic, originally presented by  Mark Headd.

http://youtu.be/hEBfXkggjtE

My app is called Info Balloon, and you can check it out at www.infoballoon.org. You move a hot air balloon avatar around on a Google map, and get access to a number of location-based services. The app also features a text input field I call the “WormHole”, which allows you to jump directly to another location on the U.S. map. It uses an html5 text input element, so it accepts either typed or spoken text. And for added fun, courtesy of Google, it knows how to deal with colloquial names for places, like “This Big Apple” and “The Windy City”.

This app is all about retrieving location-based data. It calls out to a REST-like API I created, on the backend, so it should be readily extensible to more services. Right now, I’ve got it hooked up to:

  • The National Registry of Historic Places (via NRHP database)
  • Tides (via NOAA data)
  • Google Places (via Google Places API)
  • Weather (via Google Weather API)

For services like the tide and the weather, you get the local information applying to the zip code where your Info Balloon is located. For other services, like the National Registry of Historic Places, and Google places, each time you click the “Next” button you get the next entry, in an ever-expanding perimeter.

Another feature, which I’ll have more to say about later, is that you can get the information delivered to you in any one of 10 languages, from French to Chinese.  Thanks to JQuery, whenever you change a parameter, the app immediately responds by displaying in the appropriate language, with the appropriate data from the appropriate service.

But wait, there’s one more thing, and I’ve been saving the best for last.  You dial a special Tropo access number on your phone, and get all the info window data read to you, by a language -appropriate speaker, over the phone, in real time.

This real time spoken output on your personal voice channel is what make this app fun. You can rapidly switch between services, languages, and locations, and the speech output keeps chugging away. It’s all because of the magic of Node.js, Socket.io, Redis, and of course, Tropo.

Here’s the code, in PHP,  that orchestrates the output of this voice data:

say("OK");

$redis->subscribe($cellnumber);
do {
$response = $redis->getResponse();
$json = $response[2];
if($json == "1") {
say("Press the Next button to hear the next entry.");
}
else {

$obj = json_decode($json);
$lang = $obj->{'lang'};
$message = $obj->{'message'};
$array = array(1 => "english",
2 => "spanish",
3 => "french",
4 => "german",
5 => "polish",
6 => "italian",
7 => "dutch",
8 => "french",
9 => "russian",
10 => "chinese",
11 => "russian",
12 => "portuguese");

if ($lang == "english")
$speaker = "allison";
elseif ($lang == "spanish")
$speaker = "carlos";
elseif ($lang == "french")
$speaker = "bernard";
elseif ($lang == "german")
$speaker = "stefan";
elseif ($lang == "polish")
$speaker = "zosia";
elseif ($lang == "italian")
$speaker = "luca";
elseif ($lang == "dutch")
$speaker = "willem";
elseif ($lang == "russian")
$speaker = "olga";
elseif ($lang == "chinese")
$speaker = "linlin";
elseif ($lang == "portuguese")
$speaker = "amalia";

say($message, array("voice" => $speaker));
}

} while ($message != 'goodbye');

$redis->disconnect();
say("Thanks for listening.");
hangup();

I’m excited about the notion of a personal voice channel, a number you dial up to to listen to your personalized fire hose of data. Here, it’s data about locations you are visiting on a map, but really, it could be anything. It could be a real time translation of an SMS message, or a feed of your favorite news clipping service. There’s lots of potential here which I hope to explore in future posts.

Leave a Reply

  • (will not be published)