Skip to content

Issue with local Windows paths and NRS data? #78

@xaviermouy

Description

@xaviermouy

Hello,

I was using pbp for analyzing Soundtrap data and it worked just fine. I am now looking at NRS data and am having issues with pbp-meta-gen. I am processing data from a local drive and use the same --uri argument format as what I was doing with Soundtraps but it is not able to from the .wav files to process.

Looking a bit closer at the code, I see that the way the paths are handled in NRSMetadataGenerator is different than in SoundTrapMetadataGenerator.

In SoundTrapMetadataGenerator I undertsand how the path in handles between lines 88-91.

if os.name == "nt":
     wav_path = Path(parsed_uri.netloc).joinpath(parsed_uri.path)
 else:
     wav_path = Path(parsed_uri.path)

However, in NRSMetadataGenerator it is handled with (line 77):

sound_path = Path(f"/{bucket}/{prefix}")

In my case (i.e. Windows, local folder), this creates a path that doesn't exist (i.e. it adds an unecessary '' before my actual folder path), which explains why the script cannot find any audio files.

Is there a reason why the paths are handled differently in NRSMetadataGenerator than in SoundTrapMetadataGenerator?

Thanks so much for any help you can provide!

Metadata

Metadata

Assignees

No one assigned

    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