torchaudio.kaldi_io¶
Warning
Starting with version 2.8, we are refactoring TorchAudio to transition it
into a maintenance phase. As a result, the kaldi_io
module is
deprecated in 2.8 and will be removed in 2.9.
To use this module, the dependency kaldi_io needs to be installed.
This is a light wrapper around kaldi_io
that returns torch.Tensor
.
Vectors¶
read_vec_int_ark¶
- torchaudio.kaldi_io.read_vec_int_ark(file_or_fd: Any) Iterable[Tuple[str, Tensor]] [source]¶
DEPRECATED
Warning
This function has been deprecated. It will be removed from 2.9 release. This deprecation is part of a large refactoring effort to transition TorchAudio into a maintenance phase. Please see https://github.com/pytorch/audio/issues/3902 for more information.
Create generator of (key,vector<int>) tuples, which reads from the ark file/stream.
- Parameters
file_or_fd (str/FileDescriptor) – ark, gzipped ark, pipe or opened file descriptor
- Returns
The string is the key and the tensor is the vector read from file
- Return type
Iterable[Tuple[str, Tensor]]
- Example
>>> # read ark to a 'dictionary' >>> d = { u:d for u,d in torchaudio.kaldi_io.read_vec_int_ark(file) }
read_vec_flt_scp¶
- torchaudio.kaldi_io.read_vec_flt_scp(file_or_fd: Any) Iterable[Tuple[str, Tensor]] [source]¶
DEPRECATED
Warning
This function has been deprecated. It will be removed from 2.9 release. This deprecation is part of a large refactoring effort to transition TorchAudio into a maintenance phase. Please see https://github.com/pytorch/audio/issues/3902 for more information.
Create generator of (key,vector<float32/float64>) tuples, read according to Kaldi scp.
- Parameters
file_or_fd (str/FileDescriptor) – scp, gzipped scp, pipe or opened file descriptor
- Returns
The string is the key and the tensor is the vector read from file
- Return type
Iterable[Tuple[str, Tensor]]
- Example
>>> # read scp to a 'dictionary' >>> # d = { u:d for u,d in torchaudio.kaldi_io.read_vec_flt_scp(file) }
read_vec_flt_ark¶
- torchaudio.kaldi_io.read_vec_flt_ark(file_or_fd: Any) Iterable[Tuple[str, Tensor]] [source]¶
DEPRECATED
Warning
This function has been deprecated. It will be removed from 2.9 release. This deprecation is part of a large refactoring effort to transition TorchAudio into a maintenance phase. Please see https://github.com/pytorch/audio/issues/3902 for more information.
Create generator of (key,vector<float32/float64>) tuples, which reads from the ark file/stream.
- Parameters
file_or_fd (str/FileDescriptor) – ark, gzipped ark, pipe or opened file descriptor
- Returns
The string is the key and the tensor is the vector read from file
- Return type
Iterable[Tuple[str, Tensor]]
- Example
>>> # read ark to a 'dictionary' >>> d = { u:d for u,d in torchaudio.kaldi_io.read_vec_flt_ark(file) }
Matrices¶
read_mat_scp¶
- torchaudio.kaldi_io.read_mat_scp(file_or_fd: Any) Iterable[Tuple[str, Tensor]] [source]¶
DEPRECATED
Warning
This function has been deprecated. It will be removed from 2.9 release. This deprecation is part of a large refactoring effort to transition TorchAudio into a maintenance phase. Please see https://github.com/pytorch/audio/issues/3902 for more information.
Create generator of (key,matrix<float32/float64>) tuples, read according to Kaldi scp.
- Parameters
file_or_fd (str/FileDescriptor) – scp, gzipped scp, pipe or opened file descriptor
- Returns
The string is the key and the tensor is the matrix read from file
- Return type
Iterable[Tuple[str, Tensor]]
- Example
>>> # read scp to a 'dictionary' >>> d = { u:d for u,d in torchaudio.kaldi_io.read_mat_scp(file) }
read_mat_ark¶
- torchaudio.kaldi_io.read_mat_ark(file_or_fd: Any) Iterable[Tuple[str, Tensor]] [source]¶
DEPRECATED
Warning
This function has been deprecated. It will be removed from 2.9 release. This deprecation is part of a large refactoring effort to transition TorchAudio into a maintenance phase. Please see https://github.com/pytorch/audio/issues/3902 for more information.
Create generator of (key,matrix<float32/float64>) tuples, which reads from the ark file/stream.
- Parameters
file_or_fd (str/FileDescriptor) – ark, gzipped ark, pipe or opened file descriptor
- Returns
The string is the key and the tensor is the matrix read from file
- Return type
Iterable[Tuple[str, Tensor]]
- Example
>>> # read ark to a 'dictionary' >>> d = { u:d for u,d in torchaudio.kaldi_io.read_mat_ark(file) }