DPP supports receiving audio. This examples show how to use it to record some user in a VC.
#include <dpp/dpp.h>
#include <iomanip>
#include <sstream>
int main(int argc, char const *argv[])
{
FILE *fd;
fd = fopen("./me.pcm", "wb");
std::string command;
ss >> command;
if (command == ".record") {
"You don't seem to be on a voice channel! :("
));
}
}
if (command == ".stop") {
fclose(fd);
}
});
}
});
bot.start(false);
return 0;
}
The cluster class represents a group of shards and a command queue for sending and receiving commands...
Definition: cluster.h:236
Represents a guild on Discord (AKA a server)
Definition: guild.h:311
bool connect_member_voice(snowflake user_id, bool self_mute=false, bool self_deaf=false)
Connect to a voice channel another guild member is in.
snowflake id
Definition: discord.h:44
uint64_t snowflake
A 64 bit unsigned value representing many things on discord. Discord calls the value a 'snowflake' va...
Definition: discord.h:36
DPP_EXPORT guild * find_guild(snowflake id)
Create message.
Definition: dispatcher.h:1013
message * msg
message that was created (sent). If you use any parts of this in another thread, take a copy!...
Definition: dispatcher.h:1023
Represents messages sent and received on Discord.
Definition: message.h:959
user * author
Definition: message.h:967
snowflake guild_id
Definition: message.h:965
std::string content
Definition: message.h:971
snowflake channel_id
Definition: message.h:963
voice receive packet
Definition: dispatcher.h:1289
size_t audio_size
Size of audio buffer.
Definition: dispatcher.h:1305
uint8_t * audio
Audio data, encoded as 48kHz stereo PCM or Opus.
Definition: dispatcher.h:1301
snowflake user_id
User ID of speaker (zero if unknown)
Definition: dispatcher.h:1309