Skip to content

~.store

Store

FrameStore

FrameStore(connection: VoiceConnection)

Mode-switching capable storage buffer.

Create a new frame storage object.

PARAMETER DESCRIPTION
connection

The current active connection.

TYPE: VoiceConnection

clear async

clear() -> None

Clear all internal buffers and stop any operations.

fetch_frame async

fetch_frame() -> bytes | None

Fetch the next available frame.

store_frame async

store_frame(frame: bytes | None, generation: int) -> bool

Store a frame.

PARAMETER DESCRIPTION
frame

The frame to store.

TYPE: bytes | None

generation

The current source's generation ID, to prevent stale audio from extended FFmpeg processes.

TYPE: int

RETURNS DESCRIPTION
bool

If the frame was stored.

wait async

wait(*, frames: int = 0) -> None

Wait until the store is available to read from.

PARAMETER DESCRIPTION
frames

If provided, the minimum amount of frames in store before continuing.

TYPE: int DEFAULT: 0