recipes.cad1.task2.baseline.baseline_utils module

Utility functions for the baseline model.

recipes.cad1.task2.baseline.baseline_utils.load_hrtf(config: DictConfig) dict[source]

Load the HRTF file.

Parameters:

config (DictConfig) – A dictionary-like object containing various configuration parameters for the evaluation. This includes the path to the HRTF files.

Returns:

A dictionary containing the HRTF data for the dataset.

Return type:

hrtf_data (dict)

recipes.cad1.task2.baseline.baseline_utils.load_listeners_and_scenes(config: DictConfig) tuple[dict, dict[str, Listener], dict][source]

Load listener and scene data

Parameters:

config (DictConfig) – A dictionary-like object containing various configuration parameters for the evaluation. This includes the path to the scenes file, the path to the listeners train file, and the path to the listeners valid file.

Returns:

A tuple containing the scene data, the listener data

and the pair scenes-listeners.

Return type:

Tuple[dict, dict, dict]

recipes.cad1.task2.baseline.baseline_utils.make_scene_listener_list(scenes_listeners, small_test=False)[source]

Make the list of scene-listener pairing to process

recipes.cad1.task2.baseline.baseline_utils.read_mp3(file_path: str | Path, sample_rate: float | None = None) tuple[np.ndarray, float][source]

Read a MP3 file and return its signal.

Parameters:
  • file_path (str, Path) – The path to the mp3 file.

  • sample_rate (int) – The sampling frequency of the mp3 file.

Returns:

The signal of the mp3 file. sample_rate (int): The sampling frequency of the mp3 file.

Return type:

signal (np.ndarray)