DiscordPHP-Voice Documentation

ProcessAbstract
in package

AbstractYes

Abstract class for handling audio processing in Discord voice.

This class provides methods to encode and decode audio streams using different processes.

Tags
since
10.19.0

Table of Contents

Constants

DEFAULT_KHZ  : int = 48000
Default KHz value for voice to be decoded after someone talks.

Methods

checkForExecutable()  : string|null
Checks if the specified executable is available on the system.
decode()  : Process
Decodes audio from a specific format.
encode()  : Process
Encodes audio to a specific format.

Constants

DEFAULT_KHZ

Default KHz value for voice to be decoded after someone talks.

public int DEFAULT_KHZ = 48000

Methods

checkForExecutable()

Checks if the specified executable is available on the system.

public static checkForExecutable(string $exec) : string|null
Parameters
$exec : string
Return values
string|null

decode()

Decodes audio from a specific format.

public abstract static decode([string|null $filename = null ][, int|float $volume = 0 ][, int $bitrate = 128000 ][, int $channels = 2 ][, int|null $frameSize = null ][, array<string|int, mixed>|null $preArgs = null ]) : Process
Parameters
$filename : string|null = null
$volume : int|float = 0
$bitrate : int = 128000
$channels : int = 2
$frameSize : int|null = null
$preArgs : array<string|int, mixed>|null = null
Return values
Process

encode()

Encodes audio to a specific format.

public abstract static encode([string|null $filename = null ][, int|float $volume = 0 ][, int $bitrate = 128000 ][, array<string|int, mixed>|null $preArgs = null ]) : Process
Parameters
$filename : string|null = null
$volume : int|float = 0
$bitrate : int = 128000
$preArgs : array<string|int, mixed>|null = null
Return values
Process
On this page

Search results