Ë
    ÿÍ:jj  ã                   óV  — d dl mZmZmZmZ d dlZd dlmZ d dlmZ	 d dl
mZ  e	j                  d«      rd dlZg d¢Z	 dded	ed
edeeeef      fd„Ze e	j&                  dd«      dedeeeef      fd„«       «       Ze e	j&                  dd«      dedeeeef      fd„«       «       Ze e	j&                  dd«      dedeeeef      fd„«       «       Ze e	j&                  dd«      dedeeeef      fd„«       «       Ze e	j&                  dd«      dedeeeef      fd„«       «       Zy)é    )ÚAnyÚCallableÚIterableÚTupleN)ÚTensor)Úmodule_utils)Údropping_supportÚnumpy)Úread_vec_int_arkÚread_vec_flt_scpÚread_vec_flt_arkÚread_mat_scpÚread_mat_arkÚ
file_or_fdÚfnÚconvert_contiguousÚreturnc              #   óŒ   K  —  || «      D ]5  \  }}|rt        j                  |«      }|t        j                  |«      f–— Œ7 y­w)a  Takes a method invokes it. The output is converted to a tensor.

    Args:
        file_or_fd (str/FileDescriptor): File name or file descriptor
        fn (Callable): Function that has the signature (file name/descriptor) and converts it to
            Iterable[Tuple[str, Tensor]].
        convert_contiguous (bool, optional): Determines whether the array should be converted into a
            contiguous layout. (Default: ``False``)

    Returns:
        Iterable[Tuple[str, Tensor]]: The string is the key and the tensor is vec/mat
    N)ÚnpÚascontiguousarrayÚtorchÚ
from_numpy)r   r   r   ÚkeyÚnp_arrs        úh/home/mcse/projects/srt_converter/srt-converter-venv/lib/python3.12/site-packages/torchaudio/kaldi_io.pyÚ _convert_method_output_to_tensorr      sH   è ø€ ñ ˜*“~ò ,‰ˆˆVÙÜ×)Ñ)¨&Ó1ˆFØ”5×#Ñ# FÓ+Ð+Ó+ñ,ùs   ‚AAÚkaldi_ioc                 ó:   — ddl }t        | |j                  d¬«      S )a·  Create generator of (key,vector<int>) tuples, which reads from the ark file/stream.

    Args:
        file_or_fd (str/FileDescriptor): ark, gzipped ark, pipe or opened file descriptor

    Returns:
        Iterable[Tuple[str, Tensor]]: The string is the key and the tensor is the vector read from file

    Example
        >>> # read ark to a 'dictionary'
        >>> d = { u:d for u,d in torchaudio.kaldi_io.read_vec_int_ark(file) }
    r   NT)r   )r   r   r   ©r   r   s     r   r   r   -   s   € ó  ô
 ,¨J¸×8QÑ8QÐfjÔkÐkó    c                 ó6   — ddl }t        | |j                  «      S )a¼  Create generator of (key,vector<float32/float64>) tuples, read according to Kaldi scp.

    Args:
        file_or_fd (str/FileDescriptor): scp, gzipped scp, pipe or opened file descriptor

    Returns:
        Iterable[Tuple[str, Tensor]]: The string is the key and the tensor is the vector read from file

    Example
        >>> # read scp to a 'dictionary'
        >>> # d = { u:d for u,d in torchaudio.kaldi_io.read_vec_flt_scp(file) }
    r   N)r   r   r   r   s     r   r   r   E   ó   € ó  ä+¨J¸×8QÑ8QÓRÐRr    c                 ó6   — ddl }t        | |j                  «      S )aÃ  Create generator of (key,vector<float32/float64>) tuples, which reads from the ark file/stream.

    Args:
        file_or_fd (str/FileDescriptor): ark, gzipped ark, pipe or opened file descriptor

    Returns:
        Iterable[Tuple[str, Tensor]]: The string is the key and the tensor is the vector read from file

    Example
        >>> # read ark to a 'dictionary'
        >>> d = { u:d for u,d in torchaudio.kaldi_io.read_vec_flt_ark(file) }
    r   N)r   r   r   r   s     r   r   r   Z   r"   r    c                 ó6   — ddl }t        | |j                  «      S )a¶  Create generator of (key,matrix<float32/float64>) tuples, read according to Kaldi scp.

    Args:
        file_or_fd (str/FileDescriptor): scp, gzipped scp, pipe or opened file descriptor

    Returns:
        Iterable[Tuple[str, Tensor]]: The string is the key and the tensor is the matrix read from file

    Example
        >>> # read scp to a 'dictionary'
        >>> d = { u:d for u,d in torchaudio.kaldi_io.read_mat_scp(file) }
    r   N)r   r   r   r   s     r   r   r   o   ó   € ó  ä+¨J¸×8MÑ8MÓNÐNr    c                 ó6   — ddl }t        | |j                  «      S )a¿  Create generator of (key,matrix<float32/float64>) tuples, which reads from the ark file/stream.

    Args:
        file_or_fd (str/FileDescriptor): ark, gzipped ark, pipe or opened file descriptor

    Returns:
        Iterable[Tuple[str, Tensor]]: The string is the key and the tensor is the matrix read from file

    Example
        >>> # read ark to a 'dictionary'
        >>> d = { u:d for u,d in torchaudio.kaldi_io.read_mat_ark(file) }
    r   N)r   r   r   r   s     r   r   r   „   r%   r    )F)Útypingr   r   r   r   r   r   Útorchaudio._internalr   Ú
_mod_utilsÚ!torchaudio._internal.module_utilsr	   Úis_module_availabler
   r   Ú__all__ÚboolÚstrr   Úrequires_moduler   r   r   r   r   © r    r   ú<module>r1      sã  ð÷ 2Ó 1ã Ý Ý ;Ý >à!€:×!Ñ! 'Ô*Ûò€ð ?Dñ,Øð,Ø!ð,Ø7;ð,àˆe�C˜�KÑ Ñ!ó,ð* Ø€×Ñ˜J¨Ó0ðl ð l¨°%¸¸V¸Ñ2DÑ)Eò ló 1ó ðlð, Ø€×Ñ˜J¨Ó0ðS ð S¨°%¸¸V¸Ñ2DÑ)Eò Só 1ó ðSð& Ø€×Ñ˜J¨Ó0ðS ð S¨°%¸¸V¸Ñ2DÑ)Eò Só 1ó ðSð& Ø€×Ñ˜J¨Ó0ðO˜Sð O X¨e°C¸°KÑ.@Ñ%Aò Oó 1ó ðOð& Ø€×Ñ˜J¨Ó0ðO˜Sð O X¨e°C¸°KÑ.@Ñ%Aò Oó 1ó ñOr    