Module driver

Source
Expand description

Runner for a voice connection.

Songbird’s driver is a mixed-sync system, using:

  • Asynchronous connection management, event-handling, and gateway integration.
  • Synchronous audio mixing, packet generation, and encoding.

This splits up work according to its IO/compute bound nature, preventing packet generation from being slowed down past its deadline, or from affecting other asynchronous tasks your bot must handle.

Re-exports§

pub use audiopus as opus;

Modules§

retry
Configuration for connection retries.

Structs§

Connect
Future for a call to Driver::connect.
DecodeConfig
Configuration for DecodeMode::Decode
DisposalThread
Driver
The control object for a Discord voice connection, handling connection, mixing, encoding, en/decryption, and event generation.
LiveStatBlock
Runtime statistics for an individual worker.
Scheduler
A reference to a shared group of threads used for running idle and active audio threads.
SchedulerConfig
Configuration for how a Scheduler handles tasks.

Enums§

Bitrate
Opus encoder bitrate settings.
Channels
The channel layout of output audio when using DecodeMode::Decode.
CryptoMode
Encryption schemes supportd by Discord.
DecodeMode
Decode behaviour for received RTP packets within the driver.
MixMode
Mixing behaviour for sent audio sources processed within the driver.
SampleRate
The sample rate of output audio when using DecodeMode::Decode.
SchedulerError
Errors encountered when communicating with the internals of a Scheduler.
SchedulerMode
Strategies for mapping live mixer tasks to individual threads.

Functions§

get_default_scheduler
The default shared scheduler instance.