Skip to main content

Module tracks

Module tracks 

Source
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.
TrackCallback
Asynchronous reply for an operation applied to a TrackHandle.
TrackHandle
Handle for safe control of a Track from other threads, outside of the audio mixing and voice handling context.
TrackQueue
A simple queue for several audio sources, designed to play in sequence.
TrackState
State of an Track object, designed to be passed to event handlers and retrieved remotely via TrackHandle::get_info.
View
Live track and input state exposed during TrackHandle::action.

Enums§

ControlError
Errors associated with control and manipulation of tracks.
LoopState
Looping behaviour for a Track.
PlayError
Errors reported by the mixer while attempting to play (or ready) a Track.
PlayMode
Playback status of a track.
ReadyState
Whether this track has been made live, is being processed, or is currently uninitialised.

Type Aliases§

TrackResult
Alias for most calls to a TrackHandle.