OggOpusAudioPacketizer


@UnstableApi
class OggOpusAudioPacketizer


A packetizer that encapsulates Opus audio encodings in Ogg packets.

Summary

Public constructors

Creates an instance.

Public functions

Unit
packetize(
    inputBuffer: DecoderInputBuffer!,
    initializationData: (Mutable)List<ByteArray!>!
)

Packetizes the audio data between the position and limit of the inputBuffer.

Unit

Resets the packetizer.

Public constructors

OggOpusAudioPacketizer

OggOpusAudioPacketizer()

Creates an instance.

Public functions

packetize

fun packetize(
    inputBuffer: DecoderInputBuffer!,
    initializationData: (Mutable)List<ByteArray!>!
): Unit

Packetizes the audio data between the position and limit of the inputBuffer.

Parameters
inputBuffer: DecoderInputBuffer!

The input buffer to packetize. It must be a direct ByteBuffer with LITTLE_ENDIAN order. The contents will be overwritten with the Ogg packet. The caller retains ownership of the provided buffer.

initializationData: (Mutable)List<ByteArray!>!

contains set-up data for the Opus Decoder. The data will be provided in an Ogg ID Header Page prepended to the bitstream. The list should contain either one or three byte arrays. The first item is the payload for the Ogg ID Header Page. If three items, then it also contains the Opus pre-skip and seek pre-roll values in that order.

reset

fun reset(): Unit

Resets the packetizer.