I'm issues with getting audio to work with my discord bot. Here's the section of code:
bot.joinVoiceChannel(VC, function(error, events) {
//Check to see if any errors happen while joining.
if (error) return console.error(error);
//Then get the audio context
bot.getAudioContext(VC, function(error, stream) {
//Once again, check to see if any errors exist
if (error) return console.error(error);
//Create a stream to your file and pipe it to the stream
//Without {end: false}, it would close up the stream, so make sure to include that.
play = fs.createReadStream('mpthreetest.mp3')
play.pipe(stream, {end: false});
//The stream fires `done` when it's got nothing else to send to Discord.
stream.on('done', function() {
bot.leaveVoiceChannel("VC");
});
if (error) return console.error(error);
});
});
In node I get this error:
events.js:188
throw err;
^
Error: Unhandled "error" event. (Unrecognized option 'vbr'.
Error splitting the argument list: )
at AudioCB.emit (events.js:186:19)
at AudioCB.onerror (_stream_readable.js:663:12)
at emitOne (events.js:116:13)
at AudioCB.emit (events.js:211:7)
at Socket.<anonymous> (/Users/(username)/Iris/node_modules/discord.io/lib/index.js:2451:48)
at Object.onceWrapper (events.js:315:30)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
I'm issues with getting audio to work with my discord bot. Here's the section of code:
In node I get this error: