espnet2.fileio.omniio_audio.OmniIOAudioScpReader
Less than 1 minute
espnet2.fileio.omniio_audio.OmniIOAudioScpReader
class espnet2.fileio.omniio_audio.OmniIOAudioScpReader(fname: Path | str, always_2d: bool = False, max_cache_fd: int = 32)
Bases: OmniIOEntryReader, Mapping
Reader for an scp whose entries point into Omni-IO archives.
Examples
utt1 /data/format.1/wav/blob_0.bin:0:31052 utt2 /data/format.1/wav/blob_0.bin:31052:92707
>>> reader = OmniIOAudioScpReader('wav.scp')
>>> rate, array = reader['utt1']Entries are read by OmniIOEntryReader, which keeps the bin files open.
- Parameters:
- fname – The scp file.
- always_2d – Keep the channel axis even for single-channel audio.
- max_cache_fd – Bin files kept open; 0 opens and closes per read.
Read the scp; the bin files are opened on first use.
get_path(key: str) → str
Return the scp entry of key (<bin>:<start>:<end> or “None”).
keys()
The utterance ids.
