Пример #1
0
def info(filepath):
    r"""Gets metadata from an audio file without loading the signal.

     Args:
        filepath (str): Path to audio file

     Returns:
        Tuple[sox_signalinfo_t, sox_encodinginfo_t]: A si (sox_signalinfo_t) signal
        info as a python object. An ei (sox_encodinginfo_t) encoding info

     Example
         >>> si, ei = torchaudio.info('foo.wav')
         >>> rate, channels, encoding = si.rate, si.channels, ei.encoding
     """
    return _torch_sox.get_info(filepath)
Пример #2
0
def info(filepath):
    """Gets metadata from an audio file without loading the signal.

     Args:
        filepath (string): path to audio file

     Returns: tuple(si, ei)
       - si (sox_signalinfo_t): signal info as a python object
       - ei (sox_encodinginfo_t): encoding info as a python object

     Example::
         >>> si, ei = torchaudio.info('foo.wav')
         >>> rate, channels, encoding = si.rate, si.channels, ei.encoding
     """
    return _torch_sox.get_info(filepath)
Пример #3
0
def info(filepath):
    """Gets metadata from an audio file without loading the signal.

     Args:
        filepath (string): path to audio file

     Returns: tuple(C, L, sr, precision)
       - C (int): number of audio channels
       - L (int): length of each channel in frames (samples / channels)
       - sr (int): sample rate i.e. samples per second
       - precision (float): bit precision i.e. 32-bit or 16-bit audio

     Example::
         >>> num_channels, length, sample_rate, precision = torchaudio.info('foo.wav')
     """
    C, L, sr, bp = _torch_sox.get_info(filepath)
    return C, L, sr, bp
Пример #4
0
def info(filepath):
    r"""See torchaudio.info"""

    import _torch_sox
    return _torch_sox.get_info(filepath)
Пример #5
0
def info(filepath: str) -> Tuple[SignalInfo, EncodingInfo]:
    r"""See torchaudio.info"""

    import _torch_sox
    return _torch_sox.get_info(filepath)