Skip to content

Non WAV file breaking MOTUS preparation script #74

Description

@adrianSRoman

Reference Line: https://github.com/iranroman/SpatialScaper/blob/dd130d1e0f8aef0c93f5e1b73c3445f855b92e7b/scripts/prepare_rirs.py#L198

The error looks like:

  File "scripts/prepare_rirs.py", line 528, in <module>
    prepare_motus(motus_path, sofa_path)
  File "scripts/prepare_rirs.py", line 198, in prepare_motus
    source_pos = source_positions[source_pos_index] + random.uniform(
KeyError: 'rirs.zip'

From inspection, the downloaded MOTUS directory contains .zip files. I suggest either removing the unpacked zip files or checking for .wav extension before generating RIR_file_names. I.e:

        RIR_file_names = os.listdir(dataset_path)
        if fmt == "foa":
            RIR_file_names = [f for f in RIR_file_names if "sh" in f and f.endswith(".wav")]
        elif fmt == "mic":
            RIR_file_names = [f for f in RIR_file_names if "raw" in f and f.endswith(".wav")]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions