AudioStream#
- class torchcodec.decoders.AudioStream(demuxer: Demuxer, index: int)[source]#
An audio stream followed by a
Demuxer.You should not build one yourself: a
Demuxercreates one for you.- Variables:
index (int) – The stream’s index within the container, absolute across all media types. This is what a
Packet’sstream_indexcan be compared against.
Examples using
AudioStream:- property codec_parameters: AudioCodecParameters#
What a decoder needs to know to decode this stream’s packets.
Pass them to a
AudioPacketDecoder, or pickle them to build the decoder in another process. To read the stream’s properties, usemetadatainstead. SeeAudioCodecParameters.
- make_decoder() AudioPacketDecoder[source]#
[DISCOURAGED]
Still available so that existing code keeps working. The recommended way to build an
AudioPacketDecoderis to instantiate it directly, from the stream’s codec parameters:AudioPacketDecoder(stream.codec_parameters).
- property metadata: AudioStreamHeaderMetadata#
What the container header says about this audio stream.
From the header only.