2021-04-06 00:16:09 +00:00
|
|
|
const BaseEngine=require('../BaseEngine')
|
|
|
|
const {spawn} = require('child_process')
|
|
|
|
|
|
|
|
module.exports=class extends BaseEngine {
|
|
|
|
constructor() {
|
|
|
|
super('ESpeak','wav')
|
|
|
|
}
|
|
|
|
async getSpeechFile(text, filepath, voice='en', params={}) {
|
2021-04-06 10:46:11 +00:00
|
|
|
let proc=await spawn('espeak', ['-v', voice, '-w',filepath, '--stdin']);
|
|
|
|
proc.stdin.end(text);
|
2021-04-06 00:16:09 +00:00
|
|
|
}
|
|
|
|
}
|