- From: Robert Brown <Robert.Brown@microsoft.com>
- Date: Fri, 4 Nov 2011 17:19:20 +0000
- To: HTML Speech XG <public-xg-htmlspeech@w3.org>
- Message-ID: <903FAEC5A2A8AF48951339B4035E700C054C8A@TK5EX14MBXC265.redmond.corp.microsoft.co>
Sent from my Windows Phone ________________________________ From: Robert Brown Sent: 11/4/2011 7:27 AM To: Dan Burnett (Voxeo); Michael Bodell Subject: updated re-reco example Two issues: 1. I’m not using interpretation in the way we agreed to yesterday. We can fix that up today. 2. I don’t know where to find the URI of the retained audio to assign to inputWaveformUri. <script type="text/javascript"> function listenAndClassifyThenReco() { var sr = new SpeechInputRequest(); sr.addGrammarUri("broadClassifier.grxml"); sr.onresult = function (e) { if ("broadClassifier.grxml" == sr.grammars[0].uri) { // todo: replace '.classification' with appropriate DOM API call. // Also, this switch is a little contrived. no reason why the re-reco grammar // wouldn't just be returned in the interpretation switch (e.interpretation.classification) { case "flightsearch": sr.grammars.clear(); sr.addGrammarUri("flightsearch.grxml"); break; case "hotelbooking": sr.grammars.clear(); sr.addGrammarUri("hotelbooking.grxml"); break; case "carrental": sr.grammars.clear(); sr.addGrammarUri("carrental.grxml"); break; default: throw ("cannot interpret:" + e.result.item(0).interpretation); } sr.inputWaveformUri = e.some_wave_uri_to_be_defined; //todo // re-initialize with new settings: sr.open(); // start listening: sr.start(); } else if ("flightsearch.grxml" == sr.grammars[0].uri) { processFlightSearch(e.result.item(0).interpretation); } else if ("hotelbooking.grxml" == sr.grammars[0].uri) { processHotelBooking(e.result.item(0).interpretation); } else if ("carrental.grxml" == sr.grammars[0].uri) { processCarRental(e.result.item(0).interpretation); } } sr.saveForRereco = true; sr.start(); } </script>
Received on Friday, 4 November 2011 17:27:06 UTC