DiscordPHP-Voice Documentation

RtpHeader
in package

FinalYes

Table of Contents

Constants

BASE_HEADER_SIZE  : mixed = 12

Methods

hasExtension()  : bool
Returns true when the RTP extension bit (X) is set in the packet header.
headerSize()  : int
Returns the fixed-size portion of an RTP header in bytes (base 12 + CSRC list).
stripExtensionPayload()  : string
Strips the RTP extension header and its payload from $audio.

Constants

BASE_HEADER_SIZE

private mixed BASE_HEADER_SIZE = 12

Methods

hasExtension()

Returns true when the RTP extension bit (X) is set in the packet header.

public static hasExtension(string $packet) : bool
Parameters
$packet : string
Return values
bool

headerSize()

Returns the fixed-size portion of an RTP header in bytes (base 12 + CSRC list).

public static headerSize(string $packet) : int

Does not include any extension header.

Parameters
$packet : string
Return values
int

stripExtensionPayload()

Strips the RTP extension header and its payload from $audio.

public static stripExtensionPayload(string $audio, int $headerSize) : string

The RTP extension sits immediately after the fixed header. Its size is: 4 (two-byte profile/type + two-byte length in 32-bit words) + length * 4.

Returns $audio unchanged if there is no extension.

Parameters
$audio : string
$headerSize : int
Return values
string
On this page

Search results