DiscordPHP-Voice Documentation

OpusDecoderInterface

Interface for Opus Decoder implementations.

Table of Contents

Methods

decode()  : string
Decodes one Opus packet to signed 16-bit little-endian PCM.

Methods

decode()

Decodes one Opus packet to signed 16-bit little-endian PCM.

public decode(string|mixed $data[, int $channels = 2 ][, int $audioRate = 48000 ]) : string
Parameters
$data : string|mixed

The Opus-encoded packet.

$channels : int = 2

Output channel count.

$audioRate : int = 48000

Output sample rate in Hz.

Return values
string —

The decoded PCM samples as a binary string, or an empty string on failure.

On this page

Search results