SpatialScaper icon indicating copy to clipboard operation
SpatialScaper copied to clipboard

Rooms as objects

Open beasteers opened this issue 2 years ago • 0 comments

Currently, details about rooms and their data structures live inside the Scaper object including some adhoc handling of directory structures. Moving this out should make it easier to implement things like virtual rooms in the API.

Changes:

  • SOFARoom class
    • SOFARoom.get_ambient_noise_paths formerly Scaper.use_room_ambient_noise
      • returns a list of paths instead of sampling inside the function
      • fixed minor bug which would have returned incorrect files if you were in a folder like foa_experiments
    • SOFARoom.get_irs formerly Scaper.get_room_irs_wav_xyz
      • calls SOFARoom._format_irs formerly Scaper.get_format_irs (disable format=False)
    • SOFARoom.get_positions formerly Scaper.get_room_irs_xyz
    • SOFARoom.get_boundaries formerly Scaper._get_room_min_max
  • BaseRoom added as a generic base class. May just change to Room?
  • Scaper
    • added Scaper.room: SOFARoom
    • rir_dir, room:str, format are now under SOFARoom
    • use_room_ambient_noise=True moved from Scaper.__init__ to Scaper.add_background
      • I know add_background is only intended to be run once, but I figured this would make it possible to layer ambient noise with noise generators

This is just a sketch, so feel free to discuss alterations. This PR should all be structural so the audio outputs should stay exactly the same.

I have generated some test files successfully, but my FSD50K download is only partial right now (for some reason).

beasteers avatar Apr 08 '24 21:04 beasteers