aac_datasets.utils.typing module

class AudioMetaData(
sample_rate: int,
num_frames: int,
num_channels: int,
bits_per_sample: int,
encoding: str,
)[source]

Bases: object

DEPRECATED

Warning

This class is deprecated from version 2.8. It will be removed in the 2.9 release. This deprecation is part of a large refactoring effort to transition TorchAudio into a maintenance phase. The decoding and encoding capabilities of PyTorch for both audio and video are being consolidated into TorchCodec. Please see https://github.com/pytorch/audio/issues/3902 for more information.

AudioMetaData()

Return type of torchaudio.info function.

Variables:
sample_rate : int

Sample rate

num_frames : int

The number of frames

num_channels : int

The number of channels

bits_per_sample : int

The number of bits per sample. This is 0 for lossy formats, or when it cannot be accurately inferred.

encoding : str

Audio encoding The values encoding can take are one of the following:

  • PCM_S: Signed integer linear PCM

  • PCM_U: Unsigned integer linear PCM

  • PCM_F: Floating point linear PCM

  • FLAC: Flac, Free Lossless Audio Codec

  • ULAW: Mu-law

  • ALAW: A-law

  • MP3 : MP3, MPEG-1 Audio Layer III

  • VORBIS: OGG Vorbis

  • AMR_WB: Adaptive Multi-Rate Wideband

  • AMR_NB: Adaptive Multi-Rate Narrowband

  • OPUS: Opus

  • HTK: Single channel 16-bit PCM

  • UNKNOWN : None of above