diff --git a/audiomentations/augmentations/room_simulator.py b/audiomentations/augmentations/room_simulator.py index 3a71e610..ee1ca208 100644 --- a/audiomentations/augmentations/room_simulator.py +++ b/audiomentations/augmentations/room_simulator.py @@ -204,6 +204,9 @@ def randomize_parameters(self, samples: NDArray[np.float32], sample_rate: int): raise super().randomize_parameters(samples, sample_rate) + if not self.parameters["should_apply"]: + return + self.parameters["size_x"] = random.uniform(self.min_size_x, self.max_size_x) self.parameters["size_y"] = random.uniform(self.min_size_y, self.max_size_y) self.parameters["size_z"] = random.uniform(self.min_size_z, self.max_size_z)