hikariwave.config
Configuration
BufferMode
Bases: IntEnum
Frame storage buffer modes.
MEMORY
class-attribute
instance-attribute
MEMORY = 0
All buffered frames will be stored in memory (RAM) - Only recommended for high-RAM servers/devices.
DISK
class-attribute
instance-attribute
DISK = 1
All buffered frames will be stored on the disk (storage) with configurable values and amounts - Recommended for most setups.
BufferConfig
BufferConfig(
mode: BufferMode = BufferMode.MEMORY,
*,
duration: int = None
)
Configure the frame storage buffer system.
Create a new frame storage buffer configuration.
| PARAMETER | DESCRIPTION |
|---|---|
mode
|
The frame storage buffer mode -
TYPE:
|
duration
|
If
TYPE:
|
Note
If mode is BufferMode.DISK, duration must be specified.
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
|
ValueError
|
|
duration
property
duration: int
If provided, the amount of seconds of audio each buffer cache file contains.
FFmpegConfig
Configure the FFmpeg system.
Create a new FFmpeg configuration. This configuration only affects the global state of the voice system, not per-connection.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
The system filepath to the
TYPE:
|
max_per_core
|
The maximum amount of spawned
TYPE:
|
max_total
|
The maximum amount of spawned
TYPE:
|
Config
Config(
*,
bitrate: str = "96k",
buffer: BufferConfig = None,
channels: int = 2,
ffmpeg: FFmpegConfig = None,
max_history: int = None,
max_queue: int = None,
record: bool = False,
volume: float | int | str = 1.0
)
Global or per-connection configuration settings.
Create a global or per-connection configuration object.
| PARAMETER | DESCRIPTION |
|---|---|
bitrate
|
If provided, the playback bitrate of all audio in KB/s.
TYPE:
|
buffer
|
If provided, the frame storage buffer configuration.
TYPE:
|
channels
|
If provided, the amount of audio channels that are used.
TYPE:
|
ffmpeg
|
If provided, the
TYPE:
|
max_history
|
If provided, the maximum amount of audio sources recorded in audio player history.
TYPE:
|
max_queue
|
If provided, the maximum amount of audio sources that can be in audio player queues.
TYPE:
|
record
|
If provided, sets if you can collect/handle/record members' voice packets and handle via
TYPE:
|
volume
|
If provided, the volume of all audio - Reference FFmpeg volume audio filtering. |
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
|
ValueError
|
|
ffmpeg
property
ffmpeg: FFmpegConfig
The FFmpeg system configuration - Only applicable globally, not per-connection.
max_history
property
max_history: int | None
If set, the maximum amount of audio sources that can be recorded in audio player history.
max_queue
property
max_queue: int | None
If set, the maximum amount of audio sources that can be queued in the audio player.
record
property
record: bool
If you are collecting/handling/recording members' voice packets and handling via MemberSpeechEvent.
validate_bitrate
Validate a user-provided bitrate to specific contraints.
| PARAMETER | DESCRIPTION |
|---|---|
bitrate
|
The user-provided bitrate.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
The sanitized bitrate. |
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
If |
ValueError
|
|
validate_channels
Validate user-provided channels to specific constraints.
| PARAMETER | DESCRIPTION |
|---|---|
channels
|
The user-provided channels.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
int
|
The sanitized channels. |
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
If |
ValueError
|
If |
validate_volume
Validate user-provided volume to specific contraints.
| PARAMETER | DESCRIPTION |
|---|---|
volume
|
The user-provided volume.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float | int | str
|
The sanitized volume. |
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
If |
ValueError
|
|