Fix ESpeak to use Stdin instead of a shell argument
parent
a4ccdf43cb
commit
0fd431d2bc
|
@ -5,6 +5,6 @@ module.exports = function(bot, api) {
|
||||||
const channel = await bot.channels.fetch(process.env.CHANNEL);
|
const channel = await bot.channels.fetch(process.env.CHANNEL);
|
||||||
await api.joinChannel(channel);
|
await api.joinChannel(channel);
|
||||||
|
|
||||||
api.speak(channel, `Hi! I'm alive. It is now ${new Date().toLocaleTimeString()} on ${new Date().toLocaleDateString()}`,api.ttsEngines.watson);
|
api.speak(channel, `Hi! I'm alive. It is now ${new Date().toLocaleTimeString()} on ${new Date().toLocaleDateString()}`,api.ttsEngines.espeak, "en");
|
||||||
})
|
})
|
||||||
}
|
}
|
|
@ -6,6 +6,7 @@ module.exports=class extends BaseEngine {
|
||||||
super('ESpeak','wav')
|
super('ESpeak','wav')
|
||||||
}
|
}
|
||||||
async getSpeechFile(text, filepath, voice='en', params={}) {
|
async getSpeechFile(text, filepath, voice='en', params={}) {
|
||||||
await spawn('espeak', ['-v', voice, '-w',filepath, text]);
|
let proc=await spawn('espeak', ['-v', voice, '-w',filepath, '--stdin']);
|
||||||
|
proc.stdin.end(text);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue