|
|
@ -54,7 +54,7 @@ class image2audioCommand extends Command {
|
|
|
|
.audioChannels(1)
|
|
|
|
.audioChannels(1)
|
|
|
|
.input(`${os.tmpdir()}/${message.id}1.png`)
|
|
|
|
.input(`${os.tmpdir()}/${message.id}1.png`)
|
|
|
|
.inputFormat('s16le')
|
|
|
|
.inputFormat('s16le')
|
|
|
|
.output(`${os.tmpdir()}/i2a_${message.id}.wav`)
|
|
|
|
.output(`${os.tmpdir()}/i2a_${message.id}.mp3`)
|
|
|
|
.on('error', (err, stdout, stderr) => {
|
|
|
|
.on('error', (err, stdout, stderr) => {
|
|
|
|
console.error(`${err}\n${stdout}\n${stderr}`);
|
|
|
|
console.error(`${err}\n${stdout}\n${stderr}`);
|
|
|
|
return message.channel.send('Uh oh, an error has occured!');
|
|
|
|
return message.channel.send('Uh oh, an error has occured!');
|
|
|
@ -62,7 +62,7 @@ class image2audioCommand extends Command {
|
|
|
|
.on('end', () => {
|
|
|
|
.on('end', () => {
|
|
|
|
console.log('finished');
|
|
|
|
console.log('finished');
|
|
|
|
loadingmsg.delete();
|
|
|
|
loadingmsg.delete();
|
|
|
|
return message.channel.send({files: [`${os.tmpdir()}/i2a_${message.id}.wav`]})
|
|
|
|
return message.channel.send({files: [`${os.tmpdir()}/i2a_${message.id}.mp3`]})
|
|
|
|
.catch(() => {
|
|
|
|
.catch(() => {
|
|
|
|
return message.channel.send('End result is too big to fit on discord!');
|
|
|
|
return message.channel.send('End result is too big to fit on discord!');
|
|
|
|
});
|
|
|
|
});
|
|
|
|