Expand description
Live, controllable audio instances.
Tracks add control and event data around the bytestreams offered by Input,
where each represents a live audio source inside of the driver’s mixer. This includes
play state, volume, and looping behaviour.
To configure an audio source as it is created, you can create a Track to set the
above playback state from any Input or T: Into<Input>
using Track::from(...).
To configure an audio source once it has been given to a Driver, you are given a
TrackHandle once you hand the Input and state over to be played. These handles
remotely send commands from your bot’s (a)sync context to control playback, register events,
and execute synchronous closures. This design prevents user code from being able to lock
or stall the audio mixer.
Structs§
- Action
- Actions for the mixer to take after inspecting track state via
TrackHandle::action. - Queued
- Reference to a track which is known to be part of a queue.
- Track
- Initial state for audio playback.
- Track
Callback - Asynchronous reply for an operation applied to a
TrackHandle. - Track
Handle - Handle for safe control of a
Trackfrom other threads, outside of the audio mixing and voice handling context. - Track
Queue - A simple queue for several audio sources, designed to play in sequence.
- Track
State - State of an
Trackobject, designed to be passed to event handlers and retrieved remotely viaTrackHandle::get_info. - View
- Live track and input state exposed during
TrackHandle::action.
Enums§
- Control
Error - Errors associated with control and manipulation of tracks.
- Loop
State - Looping behaviour for a
Track. - Play
Error - Errors reported by the mixer while attempting to play (or ready) a
Track. - Play
Mode - Playback status of a track.
- Ready
State - Whether this track has been made live, is being processed, or is currently uninitialised.
Type Aliases§
- Track
Result - Alias for most calls to a
TrackHandle.