dojo.provide("catchword.speech");

soundManager.flashVersion = 8;
soundManager.url = '/lib/soundmanager/swf'; // path to SoundManager2 SWF files (note trailing slash)
soundManager.debugMode = false;
soundManager.consoleOnly = false;
soundManager.onload = function(){};

function requestService() {
    console.log("requesting tts service");
    text = dojo.byId("inputText").value;
    if (text.length > 0) {
      var speaker = dojo.byId("speaker").value;
      var result = '/voices/' + speaker + '/tts/mp3?text=' + text;
      console.log('url: ', result);
      soundManager.play(result,result);
    }
    else {
      alert("Please enter text to synthesize!");
    }
}
