AudioStream#
- class torchcodec.encoders.AudioStream(encoder_tensor: Tensor, stream_index: int)[source]#
An audio stream within an
Encoder.Returned by
Encoder.add_audio(). Useadd_samples()to feed audio samples into this stream.Examples using
AudioStream:- add_samples(samples: Tensor) None[source]#
Add audio samples to this stream.
- Parameters:
samples (
torch.Tensor) – The samples to encode. This must be a 2D tensor of shape(num_channels, num_samples). Values must be float values in[-1, 1]. The number of channels must match thenum_channelspassed toEncoder.add_audio().