diff --git a/slave/textToSpeechServer.js b/slave/textToSpeechServer.js new file mode 100644 index 0000000..7054c16 --- /dev/null +++ b/slave/textToSpeechServer.js @@ -0,0 +1,32 @@ +var spawn = require('child_process').spawn, + echo = spawn('echo', ['just what do you think you are doing Dave?']), + festival = spawn('festival', ['--tts']); + +echo.stdout.on('data', function (data) { + festival.stdin.write(data); +}); + +echo.stderr.on('data', function (data) { + console.log('echo stderr: ' + data); +}); + +echo.on('close', function (code) { + if (code !== 0) { + console.log('echo process exited with code ' + code); + } + festival.stdin.end(); +}); + +festival.stdout.on('data', function (data) { + console.log('' + data); +}); + +festival.stderr.on('data', function (data) { + console.log('festival stderr: ' + data); +}); + +festival.on('close', function (code) { + if (code !== 0) { + console.log('festival process exited with code ' + code); + } +}); \ No newline at end of file