Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion spatialscaper/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def __init__(
ref_db=-60,
speed_limit=1.5,
max_sample_attempts=100,
leave_out_classes=[],
):
"""
Initializes a SpatialScaper object.
Expand Down Expand Up @@ -128,6 +129,7 @@ def __init__(
from a starting to an end point. Default is 1.5.
max_sample_attempts (int): Maximum attempts to place a sound event at a specific point in time
without exceeding max_event_overlap, before giving up . Default is 100.
leave_out_classes (list): List of sound event classes to ignore in a simulation. Default is [].

Attributes:
fg_events (list): Initialized as an empty list to hold foreground event specifications.
Expand All @@ -149,6 +151,7 @@ def __init__(
self.label_rate = __DCASE_LABEL_RATE__
self.max_event_overlap = max_event_overlap
self.max_event_dur = max_event_dur
self.leave_out_classes = leave_out_classes
self.ref_db = ref_db

self.fg_events = []
Expand All @@ -157,7 +160,7 @@ def __init__(
fg_label_list = get_label_list(self.foreground_dir)
if self.DCASE_format:
self.fg_labels = {
l: __DCASE_SOUND_EVENT_CLASSES__[l] for l in fg_label_list
l: __DCASE_SOUND_EVENT_CLASSES__[l] for l in fg_label_list if l not in self.leave_out_classes
}
else:
self.fg_labels = {l: i for i, l in enumerate(fg_label_list)}
Expand Down