Rate this Page
★ ★ ★ ★ ★

AudioStream#

class torchcodec.decoders.AudioStream(demuxer: Demuxer, index: int)[source]#

An audio stream followed by a Demuxer.

You should not build one yourself: a Demuxer creates one for you.

Variables:

index (int) – The stream’s index within the container, absolute across all media types. This is what a Packet’s stream_index can be compared against.

Examples using AudioStream:

Build your own decoding pipeline

Build your own decoding pipeline
make_decoder() → AudioPacketDecoder[source]#

Build the AudioPacketDecoder for this stream.

Returns:

A decoder for this stream’s packets.

Return type:

AudioPacketDecoder

property metadata: AudioStreamHeaderMetadata#

What the container header says about this audio stream.

From the header only.