Skip to content

Commit 99dab43

Browse files
authored
Changes required to enable FOA on TAU rooms (#55)
* changes required to enable FOA * version bump * SELDnet23 can be trained and replicates cross-validation results on STARSS23 Fold4 using the data generated with this commit.
1 parent 5b2a7f9 commit 99dab43

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

example_generation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"datasets/rir_datasets" # Directory containing Room Impulse Response (RIR) files
1010
)
1111
ROOM = "bomb_shelter" # Initial room setting, change according to available rooms listed below
12-
FORMAT = "mic" # Output format specifier
12+
FORMAT = "foa" # Output format specifier: could be 'mic' or 'foa'
1313
N_EVENTS_MEAN = 15 # Mean number of foreground events in a soundscape
1414
N_EVENTS_STD = 6 # Standard deviation of the number of foreground events
1515
DURATION = 60.0 # Duration in seconds of each soundscape, customizable by the user

spatialscaper/core.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@
6969
__ROOM_RIR_FILE__ = {
7070
"metu": "metu_sparg_em32.sofa",
7171
"arni": "arni_mic.sofa",
72-
"bomb_shelter": "bomb_shelter_mic.sofa",
73-
"gym": "gym_mic.sofa",
74-
"pb132": "pb132_mic.sofa",
75-
"pc226": "pc226_mic.sofa",
76-
"sa203": "sa203_mic.sofa",
77-
"sc203": "sc203_mic.sofa",
78-
"se203": "se203_mic.sofa",
79-
"tb103": "tb103_mic.sofa",
80-
"tc352": "tc352_mic.sofa",
72+
"bomb_shelter": "bomb_shelter_{fmt}.sofa",
73+
"gym": "gym_{fmt}.sofa",
74+
"pb132": "pb132_{fmt}.sofa",
75+
"pc226": "pc226_{fmt}.sofa",
76+
"sa203": "sa203_{fmt}.sofa",
77+
"sc203": "sc203_{fmt}.sofa",
78+
"se203": "se203_{fmt}.sofa",
79+
"tb103": "tb103_{fmt}.sofa",
80+
"tc352": "tc352_{fmt}.sofa",
8181
}
8282

8383

@@ -547,8 +547,10 @@ def get_room_irs_xyz(self):
547547
Returns:
548548
numpy.ndarray: An array of XYZ coordinates for the impulse response positions.
549549
"""
550+
if self.format == 'foa' and self.room in ['metu','arni']:
551+
raise ValueError('"metu" and "arni" rooms are currently only supported in mic (tetrahedral) format. please check again soon.')
550552
room_sofa_path = os.path.join(
551-
self.rir_dir, __SPATIAL_SCAPER_RIRS_DIR__, __ROOM_RIR_FILE__[self.room]
553+
self.rir_dir, __SPATIAL_SCAPER_RIRS_DIR__, __ROOM_RIR_FILE__[self.room].format(fmt=self.format)
552554
)
553555
return load_pos(room_sofa_path, doas=False)
554556

@@ -563,8 +565,10 @@ def get_room_irs_wav_xyz(self, wav=True, pos=True):
563565
Returns:
564566
tuple: A tuple containing the impulse responses, their sampling rate, and their XYZ positions.
565567
"""
568+
if self.format == 'foa' and self.room in ['metu','arni']:
569+
raise ValueError('"metu" and "arni" rooms are currently only supported in mic (tetrahedral) format. please check again soon.')
566570
room_sofa_path = os.path.join(
567-
self.rir_dir, __SPATIAL_SCAPER_RIRS_DIR__, __ROOM_RIR_FILE__[self.room]
571+
self.rir_dir, __SPATIAL_SCAPER_RIRS_DIR__, __ROOM_RIR_FILE__[self.room].format(fmt=self.format)
568572
)
569573
all_irs, ir_sr, all_ir_xyzs = load_rir_pos(room_sofa_path, doas=False)
570574
ir_sr = ir_sr.data[0]

spatialscaper/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
"""Version info"""
44

55
short_version = "0.1"
6-
version = "0.1.1"
6+
version = "0.1.2"

0 commit comments

Comments
 (0)