-
-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
on_voice_receive, on_voice_receive_combined, and on_voice_user_talking never trigger events #1086
Comments
Hi there! As far as I know, you need to send 0.1 second of blank audio first as Discord will not send you any audio unless you send something first. |
Does it have to be blank? I tried sending a non-blank .pcm using the bot and continued listening. I will play around more with that, but the example does not send audio first. |
It doesn't have to be blank, no :) Any audio works! If it does work after sending something, I'll look to correct our documentation. |
What I tested:
|
Using |
@braindigitalis You know this area more than I do :) |
So, I'm under the belief that this is indeed a bug. We have a doc page that tells you how to record yourself and it doesn't state you should send audio first. |
From a bit of research, discord docs don't state anything about this, so I'm going to see if D++ is receiving any data and maybe not sending out the event. |
So, I'm seeing a bot get data without even sending data. My testing program: #include <dpp/dpp.h>
int main() {
/* Setup the bot */
dpp::cluster bot("token");
bot.on_log(dpp::utility::cout_logger());
/* The event is fired when someone issues your commands */
bot.on_slashcommand([&bot](const dpp::slashcommand_t& event) {
/* Check which command they ran */
if (event.command.get_command_name() == "join") {
/* Get the guild */
dpp::guild* g = dpp::find_guild(event.command.guild_id);
/* Attempt to connect to a voice channel, returns false if we fail to connect. */
if (!g->connect_member_voice(event.command.get_issuing_user().id)) {
event.reply("You don't seem to be in a voice channel!");
return;
}
/* Tell the user we joined their channel. */
event.reply("Joined your channel!");
} else if (event.command.get_command_name() == "stop") {
event.from->disconnect_voice(event.command.guild_id);
event.reply("Left the voice channel.");
}
});
bot.on_voice_receive([&bot](const dpp::voice_receive_t &event) {
bot.log(dpp::ll_info, "on_voice_receive event fired! Data: " + std::to_string(*event.audio));
});
bot.on_ready([&bot](const dpp::ready_t & event) {
if (dpp::run_once<struct register_bot_commands>()) {
/* Create a new command. */
dpp::slashcommand joincommand("join", "Joins your voice channel and records you.", bot.me.id);
dpp::slashcommand stopcommand("stop", "Stops recording you.", bot.me.id);
bot.global_bulk_command_create({ joincommand, stopcommand });
}
});
/* Start bot */
bot.start(dpp::st_wait);
return 0;
} This gives me the following:
This was on Linux so I'll proceed to do more tests to find out. |
Yeah it's a windows thing it seems. I tested this with our latest VCPKG build and it doesn't fire there. I'll see what I can do! |
As far as I can see, the issue lies within sslclient. It quite honestly looks like more of a headache to solve than an easy one, your best option is to either always send audio until this is fixed, or run your bot on Linux (again, until this is fixed). |
Alright, thanks for checking! |
Git commit reference
e52ed92
Describe the bug
Windows x64 building using both release and debug in Visual Studio does not seem to allow for the bot to receive audio signals, even with admin privileges.
To Reproduce
Steps to reproduce the behavior:
on_voice_receive
,on_voice_receive_combined
, oron_voice_user_talking
methodExpected behavior
on_voice_receive_combined([](const dpp::voice_receive_t& event)
or aforementioned alternative to triggerSystem Details:
The text was updated successfully, but these errors were encountered: