Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
updated build
  • Loading branch information
kripken committed Feb 24, 2012
1 parent 6396b60 commit f508326
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions speakClient.js
Expand Up @@ -6,6 +6,8 @@ try {
}

function speak(text, args) {
var PROFILE = 1;

function parseWav(wav) {
function readInt(i, bytes) {
var ret = 0;
Expand Down Expand Up @@ -88,8 +90,12 @@ function speak(text, args) {
handleWav(generateSpeech(text, args));
} else {
// Call the worker, which will return a wav that we then play
var startTime = Date.now();
speakWorker.onmessage = function(event) {
if (PROFILE) console.log('speak.js: worker processing took ' + ((Date.now()-startTime)/1000).toFixed(2) + ' ms');
startTime = Date.now();
handleWav(event.data);
if (PROFILE) console.log('speak.js: wav processing took ' + ((Date.now()-startTime)/1000).toFixed(2) + ' ms');
};
speakWorker.postMessage({ text: text, args: args });
}
Expand Down
2 changes: 1 addition & 1 deletion speakGenerator.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/emscripten.sh
Expand Up @@ -19,7 +19,7 @@ mv speak speak.bc
#python ~/Dev/emscripten/tools/autodebugger.py speak.orig.ll speak.ll

echo "emscripten"
$EMSCRIPTEN/emcc -O3 -s CORRECT_SIGNS=1 --js-transform "python bundle.py" speak.bc -o speak.raw.js
$EMSCRIPTEN/emcc -O2 --js-transform "python bundle.py" speak.bc -o speak.raw.js
cat shell_pre.js > ../speakGenerator.js
cat speak.raw.js >> ../speakGenerator.js
cat shell_post.js >> ../speakGenerator.js
Expand Down

0 comments on commit f508326

Please sign in to comment.