Shortcuts

AudioSamples

class torchcodec.AudioSamples(data: Tensor, pts_seconds: float, duration_seconds: float, sample_rate: int)[source]

Audio samples with associated metadata.

Examples using AudioSamples:

Decoding audio streams with AudioDecoder

Decoding audio streams with AudioDecoder
data: Tensor

The sample data (torch.Tensor of float in [-1, 1], shape is (num_channels, num_samples)).

duration_seconds: float

The duration of the sampleas, in seconds.

pts_seconds: float

The pts of the first sample, in seconds.

sample_rate: int

The sample rate of the samples, in Hz.

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources