DiscordPHP Documentation

RecieveStream extends EventEmitter
in package
implements DuplexStreamInterface

Handles recieving audio from Discord.

Tags
since
3.2.0

Interfaces, Classes, Traits and Enums

DuplexStreamInterface

Table of Contents

$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.
__construct()  : mixed
Constructs a stream.
close()  : mixed
{@inheritDoc}
end()  : mixed
{@inheritDoc}
isReadable()  : mixed
{@inheritDoc}
isWritable()  : mixed
{@inheritDoc}
pause()  : mixed
{@inheritDoc}
pipe()  : mixed
{@inheritDoc}
pipeOpus()  : void
Pipes Opus to a destination stream.
pipePCM()  : void
Pipes PCM to a destination stream.
resume()  : mixed
{@inheritDoc}
write()  : mixed
{@inheritDoc}
writeOpus()  : void
Writes Opus audio data.
writePCM()  : void
Writes PCM audio data.

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
Return values
mixed

close()

{@inheritDoc}

public close() : mixed
Return values
mixed

end()

{@inheritDoc}

public end([mixed $data = null ]) : mixed
Parameters
$data : mixed = null
Return values
mixed

isReadable()

{@inheritDoc}

public isReadable() : mixed
Return values
mixed

isWritable()

{@inheritDoc}

public isWritable() : mixed
Return values
mixed

pause()

{@inheritDoc}

public pause() : mixed
Return values
mixed

pipe()

{@inheritDoc}

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

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.

Return values
void

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.

Return values
void

resume()

{@inheritDoc}

public resume() : mixed
Return values
mixed

write()

{@inheritDoc}

public write(mixed $data) : mixed
Parameters
$data : mixed
Return values
mixed

writeOpus()

Writes Opus audio data.

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

Opus audio data.

Return values
void

writePCM()

Writes PCM audio data.

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

PCM audio data.

Return values
void

Search results