Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non WAV file breaking MOTUS preparation script #74

Open
adrianSRoman opened this issue Aug 11, 2024 · 1 comment
Open

Non WAV file breaking MOTUS preparation script #74

adrianSRoman opened this issue Aug 11, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@adrianSRoman
Copy link
Collaborator

adrianSRoman commented Aug 11, 2024

Reference Line:

source_pos = source_positions[source_pos_index] + random.uniform(

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")]
@iranroman
Copy link
Owner

Thanks @adrianSRoman for bringing this up. We do have a flag to remove the zip files after downloading and unpacking them.

I personally did not run into this issue while testing the latest release, but I'll re-try the script to see agian. @beasteers and @karinnacvijanovich did you see this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants