podbot
podbot copied to clipboard
voiceReceiver.on('opus ... no longer receives events
Finally got around to trying some of the things we talked about for running this in AWS and now the bot isn't receiving any voice events. I tried pulling from my fork, this repo, in the Docker container, on my etc. but nothing seems to be working. Is a fresh pull of this working for you?
For the record, this is what isn't working, line 119:
voiceReceiver.on('opus', (user, data) => {
console.log('Holy shit, I got stuff!!!');
Yeah, this is an issue I've happened across intermittently. I was in the middle of trying to track it down but haven't had time.
Internally the UDP connection it has just doesn't receive audio it seems, the data events on it don't fire.
I suspect it coincides with having podbot try to record different voice channels at the same time or too close to one another.
There's one other thing worth bearing in mind - if you're transmitting audio before using the podon command then you'll need to stop and start transmitting before it'll record you, because it's missed the event that indicates you've begun talking. If you have your mic always active and there's a bit of background noise then you could potentially remain unrecorded for an entire session as a result. Muting and then unmuting yourself is typically sufficient, failing that leaving and rejoining the audio channel should work.
If I try to use podbot within Docker, the bot starts fine but doesn't respond to /podon
command and doesn't join voice chat.
Is this related to that issue ?
I really need to record Discord with separate channel and I can't find a better self-hosted alternative than podbot :(
I never had a problem with the podon command. How do you know the bot started ok? Is the container still running? What do the logs say?
On Sun, Mar 25, 2018, 5:30 AM nouts [email protected] wrote:
If I try to use podbot within Docker, the bot starts fine but doesn't respond to /podon command and doesn't join voice chat. Is this related to that issue ?
I really need to record Discord with separate channel and I can't find a better self-hosted alternative than podbot :(
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Fiddlekins/podbot/issues/17#issuecomment-375966864, or mute the thread https://github.com/notifications/unsubscribe-auth/ACA7oHEtrlAjHKdw5YwlUhIyZRCJWYuwks5th437gaJpZM4SxXPZ .
Well... it says "connected". The container keep running and podbot appears online.
I only have a deprecated warning from nodejs. I guess it's "normal". And nothing showed up in the log when I type podon command.
Do I need specific network option for docker ?
I ran docker run -d --name podbot --env-file config.ini -v ./podcasts:/opt/podbot/podcasts podbot
Oh I'd guess you haven't created a server role for your user.
On Fri, Mar 30, 2018, 7:56 AM nouts [email protected] wrote:
Well... it says "connected". The container keep running and podbot appears online. I only have a deprecated warning from nodejs. I guess it's "normal". And nothing showed up in the log when I type podon command. Do I need specific network option for docker ? I ran docker run -d --name podbot --env-file config.ini -v ./podcasts:/opt/podbot/podcasts podbot
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Fiddlekins/podbot/issues/17#issuecomment-377542145, or mute the thread https://github.com/notifications/unsubscribe-auth/ACA7oMLTBgeHD04MCRt5wtqbqXNfDVjFks5tjke5gaJpZM4SxXPZ .
I had the role set correctly.
I changed the Dockerfile to make it copy the config.json inside the image, as I wasn't sure the --env-file
option was working correctly. I had a problem with permissions on the directory podcasts. Now with or without docker, podbot appears online, responds to command, joins the voice chat, creates a new timestamped folder under podcasts/, but doesn't record anything.
I am back to https://github.com/Fiddlekins/podbot/issues/16 :( So it's not related to my environment I guess.
Discord pushed changes a few weeks ago that broke audio receiving; the workaround some are doing with JDA (different library) requires one to send audio or some buffer of silence from the bot. The bug is mentioned here -- anyway, until that is fixed the workaround is above. It's not a priority right now but if you really need it, it can be done: https://github.com/guacamoledragon/throw-voice/pull/61/commits/5be4cdf487016080f4ae960bc0220d60843f164d (JDA example).
Ah, that might explain why nothing worked when I last tried debugging the dodgy recording last weekend...
I finally got to the bottom of sodium version issues but wanted to get the recording problems sorted before posting anything.
Thanks for the heads up anyway, I'll see if I can squeeze in some time this week. Bit more motivated now that I know what to look into.
Maybe try using this branch and rewriting as needed - looks like the Receiver was documented 18 days ago:
https://github.com/discordjs/discord.js/commits/voice-krypton/src/client/voice/receiver
As described there, one workaround is to play a silence stream
const { Readable } = require('stream'); const SILENCE_FRAME = Buffer.from([0xF8, 0xFF, 0xFE]); class Silence extends Readable { _read() { this.push(SILENCE_FRAME); } } // play silence indefinitely, this should allow you to continue receiving audio voiceConnection.playOpusStream(new Silence());
The master branch of discord.js has this fix in already, so rather than implement it myself I've opted to upgrading the version of discord.js used.
Which has involved rewriting the bot in a fairly large way.
It might be more stable. It definitely now uses more disk space when first recording, since it outputs as raw PCM rather than as opus (this means that you don't need to decode the opus whilst post processing it now though). There's also a few things that need tidying and fixing, such as game state.
I should be able to find some time over the coming week to get the podbot instance I host on a linux vm up to date with the latest changes and see how it performs there, and also grab a bunch of people to confirm that output is acceptable following my tomfoolery.