vak.common.files.spect.load

vak.common.files.spect.load(spect_path: str | Path, spect_format: str | None = None)[source]

load spectrogram and related arrays from a file, return as an object that provides Python dictionary-like access

Parameters:
  • spect_path (str, Path) – to an array file.

  • spect_format (str) – Valid formats are defined in vak.io.spect.SPECT_FORMAT_LOAD_FUNCTION_MAP. Default is None, in which case the extension of the file is used.

Returns:

spect_dict – either a dictionary or dictionary-like object that provides access to arrays from the filefrom pathlib import Path via keys, e.g. spect_dict[‘s’] for the spectrogram. See docstring for vak.audio.to_spect for default keys for spectrogram array files that function creates.

Return type:

dict-like