Skip to content

Commit

Permalink
Merge pull request #336 from qwaker00/patch-1
Browse files Browse the repository at this point in the history
Don't calculate heavy room parameters if augmentation is not going to be applied
  • Loading branch information
iver56 authored Apr 29, 2024
2 parents 956e3ca + dd6cf05 commit fe04ca2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions audiomentations/augmentations/room_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fe04ca2

Please sign in to comment.