#CXXFLAGS+=-s USE_PTHREADS=1 | #CXXFLAGS+=-s USE_PTHREADS=1 | ||||
# NOTE: extra flags for emscripten | # NOTE: extra flags for emscripten | ||||
EM_CXXFLAGS=-s RESERVED_FUNCTION_POINTERS=2 --memory-init-file 0 | |||||
EM_CXXFLAGS=-s RESERVED_FUNCTION_POINTERS=2 --memory-init-file 0 -s FORCE_FILESYSTEM=1 -s WASM=0 | |||||
tts.synthesize( | tts.synthesize( | ||||
user_text, | user_text, | ||||
function cb(samples, events) { | function cb(samples, events) { | ||||
//console.log(' Inside synt cb'); | |||||
console.log(' Receiving synthesis samples...'); | |||||
if (!samples) { | if (!samples) { | ||||
if (pusher) { | if (pusher) { | ||||
pusher.close(); | pusher.close(); | ||||
); // end of tts.synthesize() | ); // end of tts.synthesize() | ||||
console.log(' Calling synthesize... done'); | console.log(' Calling synthesize... done'); | ||||
console.log('Leaving speak()'); | console.log('Leaving speak()'); | ||||
} // end of speak() | } // end of speak() | ||||
function ipa() { | function ipa() { |
return aCallback(data, events) ? 1 : 0; | return aCallback(data, events) ? 1 : 0; | ||||
} | } | ||||
var fp = Runtime.addFunction(cb); | |||||
var fp = addFunction(cb); | |||||
this.synth_(aText, fp); | this.synth_(aText, fp); | ||||
Runtime.removeFunction(fp); | |||||
removeFunction(fp); | |||||
}; | }; | ||||
eSpeakNGWorker.prototype.synthesize_ipa = function (aText, aCallback) { | eSpeakNGWorker.prototype.synthesize_ipa = function (aText, aCallback) { |