Skip to content

Automatic transcoding feature, RecordID, and $enter without args.#16

Open
capthndsme wants to merge 1 commit intochebro:masterfrom
capthndsme:master
Open

Automatic transcoding feature, RecordID, and $enter without args.#16
capthndsme wants to merge 1 commit intochebro:masterfrom
capthndsme:master

Conversation

@capthndsme
Copy link

Implemented the following features:
Automatic transcoding feature

  • Runs merge.js on record stop.
  • Merge.js runs ffmpeg to transcode.
  • This requires a record id feature to be implemented.

You can now enter without args. This will join the user's current voice channel.

Added JSON metadata.

  • This contains who started the recording, and timestamps of voice start/end.

@chebro
Copy link
Owner

chebro commented Apr 23, 2021

@capthndsme hey there, thanks for contributing!

I'm a little busy with school atm, the changes look good on first glance (thanks to the detailed info), I'll go through it in detail sometime soon, hopefully before this month :)

Copy link
Owner

@chebro chebro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good enhancement! I really like the guild lock thingy 😄

There are just a few issues with the PR and I'm a bit iffy about the necessity of including metadata but overall, great work!

Also, the code formatting is a mess (including mine :P), I should probably add a pre commit hook to fix that.

`${__dirname}/../recordings/${recId}/rendered.mp3`
]

const ffmpegChild = spawn('ffmpeg', ffmpegArgs);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this module depends on ffmpeg-static, you could do something like:

const ffmpeg = require('ffmpeg-static');

const ffmpegConvert = () {
    require('child_process').execSync(`${ffmpeg} -f s16le -ar 48000 -ac 2\
        -i recordings/${recId}/merged.pcm\
        recordings/${recId}/rendered.mp3`);
}

This would not need ffmpeg as a system level dependency.

const dispatcher = conn.play(__dirname + '/../sounds/drop.mp3');
dispatcher.on('finish', () => { console.log(`Joined ${voiceChannel.name}!\n\nREADY TO RECORD\n`); });

console.log(voiceChannel);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line can be removed? It is polluting the console with rather useless information.


console.log(`Sliding into ${voiceChannel.name} ...`);
voiceChannel.join()
if (typeof(activeGuildRecorders[msg.member.voice.channel.guild.id]) === "undefined") {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'll be best to put this if-else block inside a try-catch block because the bot crashes if a guild member is not in a voice channel and runs a command like !enter invalidVoiceChannelName

@gamer50082
Copy link

Can you update this to fit with the new updated command.js as this contains the cannot find channel bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants