define("editor/assert/js/addon/msptts",[],function(require,exports){function a(a,b,c){for(var d=$.Deferred(),f={originalWords:"",resultJsonArr:[]},g="",h=0;h<a.words.length;h++){var i=a.words[h].audio;i=i.replace(".mp3","");var j=c+"/"+i+".wav",k='{"SynthText": "'+a.words[h].word+'", "VoiceSpeecher": "'+b+'", "WordSpeed": "3", "UseCSSML": "0", "AudioPath": "'+j+'"}';g+=k+"|"}return g=g.substr(0,g.length-1),e.asyncTTSBat(g,function(a,b){f.resultJsonArr=b.split("|"),d.resolve(f)}),d.promise()}function b(b,c,d,e){var f=$.Deferred(),g=null,h=function(i){e>i&&a(b,c,d).done(function(a){console.log("textToSpeechWithTryTimes:"+JSON.stringify(a)),g=a;for(var b=a.resultJsonArr,c=!0,d=0;d<b.length;d++){if(""==b[d]){c=!1;break}var e=JSON.parse(b[d]);if(console.log(e.audioFlag),"false"==e.audioFlag||""==e.result){c=!1;break}}console.log(c),0==c?(console.log("textToSpeechWithTryTimes Fail, try again!"),h(++i)):(console.log("textToSpeechWithTryTimes succeed,return"),f.resolve(a))}),i==e&&(console.log("textToSpeechWithTryTimes timesover,return"),f.resolve(g))};return h(0),f.promise()}function c(a,b,c){for(var d=$.Deferred(),f={originalWords:"",resultJsonArr:[]},g="",h=0;h<a.sens.length;h++){var i=c+"/"+a.sens[h].audio;i=i.replace(".mp3",".wav");var j=a.sens[h].text;j=j.replace(/[\.\?!]/gi,","),console.log(j);var k='{"SynthText": "'+j+'", "VoiceSpeecher": "'+b+'", "WordSpeed": "3", "UseCSSML": "0", "AudioPath": "'+i+'"}';g+=k+"|"}return g=g.substr(0,g.length-1),e.asyncTTSBat(g,function(a,b){f.resultJsonArr=b.split("|"),d.resolve(f)}),d.promise()}function d(a,b,d,e){var f=$.Deferred(),g=null,h=function(i){e>i&&c(a,b,d).done(function(a){console.log("situTTSWithTryTimes:"),console.log(a),g=a;var b=a.resultJsonArr,c=!0;console.log(b.length);for(var d=0;d<b.length;d++){if(console.log(b[d]),""==b[d]){c=!1;break}var e=JSON.parse(b[d]);if(console.log(e),console.log(e.audioFlag),"false"==e.audioFlag||""==e.result){c=!1;break}}console.log(c),0==c?(console.log("situTTSWithTryTimes Fail, try again!"),h(++i)):(console.log("situTTSWithTryTimes succeed,return"),f.resolve(a))}),i==e&&(console.log("situTTSWithTryTimes timesover,return"),f.resolve(g))};return h(0),f.promise()}var e=window.require("./node_modules/tts/tts");exports.textToSpeechWithTryTimes=b,exports.situTTSWithTryTimes=d});