Gleydar
Member
Hello, I have recently tried to implement recording on command with the bot. This is the basic Code I use so far:
The file for the recording is created as expected, but it stays at one kb and doesn't grow at all, even when the bot is playing audio.
Does anyone of you have experience with that kind of stuff? Maybe even implemented recording? I would be happy about any help! Thanks in advance!
Code:
function(sinusbot, config) {
var recording = false;
var engine = require('engine');
var audio = require('audio');
var event = require('event');
sinusbot.on('chat', function(ev)
{
var users = config.AllowedUsers.split(",");
if(ev.msg == config.RecordingCmd) {
for(var i = 0; i < users.length; i++) {
var uid = users[i];
if(ev.clientUid == uid) {
if(!recording) {
sinusbot.setARC(0x01);
audio.startRecording();
recording = true;
engine.log("Starting to record because of " + ev.clientUid);
} else {
audio.stopRecording();
recording = false;
engine.log("Stopped recording because of " + ev.clientUid);
}
}
}
}
});
});
Does anyone of you have experience with that kind of stuff? Maybe even implemented recording? I would be happy about any help! Thanks in advance!