danog\MadelineProto\Ogg: Async OGG stream reader and writer.
Author: Daniil Gentili daniil@daniil.it
Author: Charles-Édouard Coste contact@ccoste.fr
Async OGG stream reader and writer.
Constants
danog\MadelineProto\Ogg::CONTINUATION:danog\MadelineProto\Ogg::BOS:danog\MadelineProto\Ogg::EOS:danog\MadelineProto\Ogg::STATE_READ_HEADER:danog\MadelineProto\Ogg::STATE_READ_COMMENT:danog\MadelineProto\Ogg::STATE_STREAMING:danog\MadelineProto\Ogg::STATE_END:
Properties
$pageOffset:intByte offset of the OGG page currently being read.
This is a page boundary, so re-opening the file here with the $startOffset constructor
argument resumes reading exactly this page, which is what makes playback byte-offset
resumable across a serialize/unserialize cycle.
$opusPackets:iterable<string>Opus packet iterator.$vendorString:string$comments:list<string>
Method list:
__construct(\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream $stream, ?\Amp\Cancellation $cancellation = NULL, int $startOffset = 0)packetDuration(string $packet): intvalidate(\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream $file, ?\Amp\Cancellation $cancellation = NULL): voidconvert((\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream) $in, (\danog\MadelineProto\LocalFile|\Amp\ByteStream\WritableStream) $oggOut, ?\Amp\Cancellation $cancellation = NULL): voidvalidateOgg(\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream $f): voidconvertWav((\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream) $wavIn, (\danog\MadelineProto\LocalFile|\Amp\ByteStream\WritableStream) $oggOut, ?\Amp\Cancellation $cancellation = NULL): void
Methods:
__construct(\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream $stream, ?\Amp\Cancellation $cancellation = NULL, int $startOffset = 0)
Constructor.
Parameters:
$stream:\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream$cancellation:?\Amp\Cancellation$startOffset:int
See also:
\danog\MadelineProto\LocalFile: Indicates a local file to upload.\danog\MadelineProto\RemoteUrl: Indicates a remote URL to upload.\Amp\ByteStream\ReadableStream\Amp\Cancellation
packetDuration(string $packet): int
Get the duration of an OPUS packet, in 48kHz samples (0 if the packet is malformed).
The duration is read from the TOC byte (and, for packets with an arbitrary number of frames,
from the frame count byte) of the packet, see RFC 6716 §3.1.
Parameters:
$packet:string
validate(\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream $file, ?\Amp\Cancellation $cancellation = NULL): void
Validate that the specified file, URL or stream is a valid VoIP OGG OPUS file.
Parameters:
$file:\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream$cancellation:?\Amp\Cancellation
See also:
\danog\MadelineProto\LocalFile: Indicates a local file to upload.\danog\MadelineProto\RemoteUrl: Indicates a remote URL to upload.\Amp\ByteStream\ReadableStream\Amp\Cancellation
convert((\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream) $in, (\danog\MadelineProto\LocalFile|\Amp\ByteStream\WritableStream) $oggOut, ?\Amp\Cancellation $cancellation = NULL): void
Converts a file, URL, or stream of any format (including video) into an OGG audio stream suitable for consumption by MadelineProto’s VoIP implementation.
Parameters:
$in:(\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream)The input file, URL or stream.$oggOut:(\danog\MadelineProto\LocalFile|\Amp\ByteStream\WritableStream)The output file or stream.$cancellation:?\Amp\Cancellation
See also:
\danog\MadelineProto\LocalFile: Indicates a local file to upload.\danog\MadelineProto\RemoteUrl: Indicates a remote URL to upload.\Amp\ByteStream\ReadableStream\Amp\ByteStream\WritableStream\Amp\Cancellation
validateOgg(\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream $f): void
Validate that the specified OGG OPUS file can be played directly by MadelineProto, without doing any conversion.
Parameters:
$f:\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream
See also:
\danog\MadelineProto\LocalFile: Indicates a local file to upload.\danog\MadelineProto\RemoteUrl: Indicates a remote URL to upload.\Amp\ByteStream\ReadableStream
convertWav((\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream) $wavIn, (\danog\MadelineProto\LocalFile|\Amp\ByteStream\WritableStream) $oggOut, ?\Amp\Cancellation $cancellation = NULL): void
Converts a file, URL, or stream in WAV format @ 48khz into an OGG audio stream suitable for consumption by MadelineProto’s VoIP implementation.
Parameters:
$wavIn:(\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream)The input file, URL or stream.$oggOut:(\danog\MadelineProto\LocalFile|\Amp\ByteStream\WritableStream)The output file or stream.$cancellation:?\Amp\Cancellation
See also:
\danog\MadelineProto\LocalFile: Indicates a local file to upload.\danog\MadelineProto\RemoteUrl: Indicates a remote URL to upload.\Amp\ByteStream\ReadableStream\Amp\ByteStream\WritableStream\Amp\Cancellation
Generated by danog/phpdoc