Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hagenw committed Jul 5, 2024
1 parent f86d400 commit 7c23966
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions auglib/core/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ def __call__(
if signal.dtype != DTYPE:
signal = signal.astype(DTYPE)

# Ensure signal is not read-only
# (https://github.com/audeering/auglib/issues/31)
if not signal.flags["WRITEABLE"]:
signal = signal.copy()

if preserve_level:
signal_level = rms_db(signal)

Expand Down Expand Up @@ -2056,10 +2061,6 @@ def _call(

signal = self.function(signal, sampling_rate, **args)

# Ensure signal is not read-only
if not signal.flags["WRITEABLE"]:
signal = signal.copy()

return signal


Expand Down

0 comments on commit 7c23966

Please sign in to comment.