DiscordPHP-Voice Documentation

RecieveStream
in package
implements DuplexStreamInterface uses EventEmitterTrait

Handles recieving audio from Discord.

The class was renamed, kept for backwards compatibility.

Tags
since
3.2.0

Table of Contents

Interfaces

DuplexStreamInterface

Constants

MAX_PAUSE_BUFFER  : mixed = 512
Maximum number of frames to buffer while paused.

Properties

$isClosed  : bool
Whether the stream is closed.
$isPaused  : bool
Is the stream paused?
$opusData  : string
Contains Opus data.
$opusPauseBuffer  : array<string|int, mixed>
The pause buffer.
$pcmData  : string
Contains PCM data.
$pcmPauseBuffer  : array<string|int, mixed>
The PCM pause buffer.

Methods

__construct()  : mixed
Constructs a stream.
close()  : mixed
end()  : mixed
isReadable()  : mixed
isWritable()  : mixed
pause()  : mixed
pipe()  : mixed
pipeOpus()  : void
Pipes Opus to a destination stream.
pipePCM()  : void
Pipes PCM to a destination stream.
resume()  : mixed
write()  : mixed
writeOpus()  : void
Writes Opus audio data.
writePCM()  : void
Writes PCM audio data.

Constants

MAX_PAUSE_BUFFER

Maximum number of frames to buffer while paused.

private mixed MAX_PAUSE_BUFFER = 512

Properties

$isClosed

Whether the stream is closed.

protected bool $isClosed = false

Whether the stream is closed.

$isPaused

Is the stream paused?

protected bool $isPaused

Whether the stream is paused.

$opusData

Contains Opus data.

protected string $opusData = ''

Opus data.

$opusPauseBuffer

The pause buffer.

protected array<string|int, mixed> $opusPauseBuffer = []

The pause buffer.

$pcmData

Contains PCM data.

protected string $pcmData = ''

PCM data.

$pcmPauseBuffer

The PCM pause buffer.

protected array<string|int, mixed> $pcmPauseBuffer = []

The PCM pause buffer.

Methods

__construct()

Constructs a stream.

public __construct() : mixed

end()

public end([mixed $data = null ]) : mixed
Parameters
$data : mixed = null
Tags
inheritDoc

pipe()

public pipe(WritableStreamInterface $dest[, array<string|int, mixed> $options = [] ]) : mixed
Parameters
$dest : WritableStreamInterface
$options : array<string|int, mixed> = []
Tags
inheritDoc

pipeOpus()

Pipes Opus to a destination stream.

public pipeOpus(WritableStreamInterface $dest[, array<string|int, mixed> $options = [] ]) : void
Parameters
$dest : WritableStreamInterface

The stream to pipe to.

$options : array<string|int, mixed> = []

An array of options.

pipePCM()

Pipes PCM to a destination stream.

public pipePCM(WritableStreamInterface $dest[, array<string|int, mixed> $options = [] ]) : void
Parameters
$dest : WritableStreamInterface

The stream to pipe to.

$options : array<string|int, mixed> = []

An array of options.

write()

public write(mixed $data) : mixed
Parameters
$data : mixed
Tags
inheritDoc

writeOpus()

Writes Opus audio data.

public writeOpus(string $opus) : void
Parameters
$opus : string

Opus audio data.

writePCM()

Writes PCM audio data.

public writePCM(string $pcm) : void
Parameters
$pcm : string

PCM audio data.

On this page

Search results