add phoneme on

This commit is contained in:
Loïc Bersier 2019-07-18 04:21:19 +02:00
parent 4edf84b66f
commit 2ad60dbb1f
2 changed files with 8 additions and 6 deletions

View file

@ -29,17 +29,18 @@ class dectalkCommand extends Command {
async exec(message, args) {
args.decMessage = rand.random(args.decMessage, message);
args.decMessage = args.decMessage.replace('\n', ' ');
let decMessage = '[:phoneme on] ' + args.decMessage;
if (process.platform == 'win32') {
exec(`cd .\\dectalk && .\\say.exe -w dectalk.wav "${args.decMessage}"`)
exec(`cd .\\dectalk && .\\say.exe -w dectalk.wav "${decMessage}"`)
.catch(err => {
return console.error(err);
})
.then(() => {
return message.channel.send({files: ['./dectalk/dectalk.wav']});
});
} else if (process.platform == 'linux') {
exec(`cd dectalk && DISPLAY=:0.0 wine say.exe -w dectalk.wav "${args.decMessage}"`)
} else if (process.platform == 'linux' || process.platform == 'darwin') {
exec(`cd dectalk && DISPLAY=:0.0 wine say.exe -w dectalk.wav "${decMessage}"`)
.catch(err => {
return console.error(err);
})

View file

@ -29,9 +29,10 @@ class dectalkvcCommand extends Command {
async exec(message, args) {
args.decMessage = rand.random(args.decMessage, message);
args.decMessage = args.decMessage.replace('\n', ' ');
let decMessage = '[:phoneme on] ' + args.decMessage;
if (process.platform == 'win32') {
exec(`cd .\\dectalk && .\\say.exe -w dectalkvc.wav "${args.decMessage}"`)
exec(`cd .\\dectalk && .\\say.exe -w dectalkvc.wav "${decMessage}"`)
.catch(err => {
return console.error(err);
})
@ -50,8 +51,8 @@ class dectalkvcCommand extends Command {
}
});
} else if (process.platform == 'linux') {
exec(`cd dectalk && DISPLAY=:0.0 wine say.exe -w dectalkvc.wav "${args.decMessage}"`)
} else if (process.platform == 'linux' || process.platform == 'darwin') {
exec(`cd dectalk && DISPLAY=:0.0 wine say.exe -w dectalkvc.wav "${decMessage}"`)
.catch(err => {
return console.error(err);
})