Module songbird::tracks[][src]

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.

To prevent locking and stalling of the driver, tracks are controlled from your bot using a TrackHandle. These handles remotely send commands from your bot's (a)sync context to control playback, register events, and execute synchronous closures.

If you want a new track from an Input, i.e., for direct control before playing your source on the driver, use create_player.

Structs

Queued

Reference to a track which is known to be part of a queue.

Track

Control object for audio playback.

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.

Enums

LoopState

Looping behaviour for a Track.

PlayMode

Playback status of a track.

TrackCommand

A request from external code using a TrackHandle to modify or act upon an Track object.

TrackError

Errors associated with control and manipulation of tracks.

Functions

create_player

Creates a Track object to pass into the audio context, and a TrackHandle for safe, lock-free access in external code.

create_player_with_uuid

Creates a Track and TrackHandle as in create_player, allowing a custom UUID to be set.

Type Definitions

TrackResult

Alias for most calls to a TrackHandle.