textToSpeech functionality
This commit is contained in:
Родитель
3b8108effd
Коммит
ce2f6b970b
|
@ -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);
|
||||
}
|
||||
});
|
Загрузка…
Ссылка в новой задаче