@UnstableApi
class VorbisUtil


Utility methods for parsing Vorbis streams.

Summary

Public functions

java-static ImmutableIntArray?

Returns the mapping from VORBIS channel layout to the channel layout expected by Android, or null if the mapping is unchanged.

java-static Metadata?
parseVorbisComments(vorbisComments: (Mutable)List<String!>!)

Builds a Metadata instance from a list of Vorbis Comments.

java-static ImmutableList<ByteArray<Byte>!>!

Returns codec-specific data for configuring a media codec for decoding Vorbis.

Public functions

getVorbisToAndroidChannelLayoutMapping

java-static fun getVorbisToAndroidChannelLayoutMapping(channelCount: Int): ImmutableIntArray?

Returns the mapping from VORBIS channel layout to the channel layout expected by Android, or null if the mapping is unchanged.

See https://www.xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-810004.3.9 and https://developer.android.com/reference/android/media/AudioFormat#channelMask.

parseVorbisComments

java-static fun parseVorbisComments(vorbisComments: (Mutable)List<String!>!): Metadata?

Builds a Metadata instance from a list of Vorbis Comments.

METADATA_BLOCK_PICTURE comments will be transformed into PictureFrame entries. All others will be transformed into VorbisComment entries.

Parameters
vorbisComments: (Mutable)List<String!>!

The raw input of comments, as a key-value pair KEY=VAL.

Returns
Metadata?

The fully parsed Metadata instance. Null if no vorbis comments could be parsed.

parseVorbisCsdFromEsdsInitializationData

java-static fun parseVorbisCsdFromEsdsInitializationData(initializationData: ByteArray!): ImmutableList<ByteArray<Byte>!>!

Returns codec-specific data for configuring a media codec for decoding Vorbis.

Parameters
initializationData: ByteArray!

The initialization data from the ESDS box.

Returns
ImmutableList<ByteArray<Byte>!>!

Codec-specific data for configuring a media codec for decoding Vorbis.