lavalink_rs.model.player

class Player:

Information about the player of a guild.

The state of the player.

The filters currently in use by the player

The voice connection information of the player.

track: Optional[TrackData]

The currently playing track.

guild_id: GuildId
paused: bool

Whether the player is paused or not.

volume: int

The current volume of the player.

class State:
connected: bool

Whether Lavalink is connected to the discord voice gateway.

ping: Optional[int]

The latency of the node to the Discord voice gateway in milliseconds.

None if not connected.

position: int

The current position of the track in milliseconds.

time: int

Unix timestamp in milliseconds.

class ConnectionInfo:

Discord voice websocket connection information.

session_id: str

The Discord voice session id to authenticate with.

Not to be confused by the Lavalink session_id.

Provided by Voice State Update.

token: str

The Discord voice token to authenticate with.

Provided by Voice Server Update.

endpoint: str

The Discord voice endpoint to connect to.

Provided by Voice Server Update.

class Filters:
distortion: Optional[lavalink_rs.model.player.Distortion]
low_pass: Optional[lavalink_rs.model.player.LowPass]
equalizer: Optional[List[lavalink_rs.model.player.Equalizer]]
rotation: Optional[lavalink_rs.model.player.Rotation]
volume: Optional[int]
timescale: Optional[lavalink_rs.model.player.Timescale]
channel_mix: Optional[lavalink_rs.model.player.ChannelMix]
class ChannelMix:

Mixes both channels (left and right), with a configurable factor on how much each channel affects the other.

With the defaults, both channels are kept independent of each other. Setting all factors to 0.5 means both channels get the same audio. All values are (0.0 <= x <= 1.0)

left_to_left: Optional[float]
left_to_right: Optional[float]
right_to_left: Optional[float]
right_to_right: Optional[float]
class Distortion:

Distortion effect.

It can generate some pretty unique audio effects.

tan_scale: Optional[float]
sin_offset: Optional[float]
sin_scale: Optional[float]
tan_offset: Optional[float]
cos_scale: Optional[float]
cos_offset: Optional[float]
offset: Optional[float]
scale: Optional[float]
class Equalizer:

A fixed band equalizer.

gain: float

The gain (-0.25 to 1.0)

-0.25 means the given band is completely muted, and 0.25 means it is doubled. Modifying the gain could also change the volume of the output.

band: int

The band (0 to 14)

class Karaoke:

Uses equalization to eliminate part of a band, usually targeting vocals.

level: Optional[float]

The level (0 to 1.0 where 0.0 is no effect and 1.0 is full effect)

filter_width: Optional[float]

The filter width.

filter_band: Optional[float]

The filter band (in Hz)

mono_level: Optional[float]

The mono level (0 to 1.0 where 0.0 is no effect and 1.0 is full effect)

class LowPass:

Higher frequencies get suppressed, while lower frequencies pass through this filter.

smoothing: Optional[float]

The smoothing factor (1.0 < x)

Any smoothing values equal to or less than 1.0 will disable the filter.

class Rotation:

Rotates the sound around the stereo channels/user headphones (aka Audio Panning).

It can produce an effect similar to this without the reverb.

rotation_hz: Optional[float]

The frequency of the audio rotating around the listener in Hz.

0.2 is similar to the example video above

class Timescale:

Changes the speed, pitch, and rate.

All default to 1.0.

rate: Optional[float]

The rate (0.0 <= x)

pitch: Optional[float]

The pitch (0.0 <= x)

speed: Optional[float]

The playback speed (0.0 <= x)

class TremoloVibrato:

Tremolo uses amplification to create a shuddering effect, where the volume quickly oscillates.

Demo

Vibrato is similar to tremolo, but rather than oscillating the volume, it oscillates the pitch.

frequency: Optional[float]

For tremolo (0.0 < x) For vibrato (0.0 < x <= 14.0)

depth: Optional[float]

For both tremolo and vibrato (0.0 < x <= 1.0)