mirror of
https://github.com/pyannote/pyannote-audio.git
synced 2026-11-20 13:07:51 +09:00
fix: fix Audio.crop with negative start time and mode="pad"
This commit is contained in:
1 parent
243ca71c6f
commit
4e558df3ee
1 file changed
+1
@@ -358,6 +358,7 @@ class Audio:
|
||||
pad_end = max(end_frame, frames) - frames
|
||||
start_frame = max(0, start_frame)
|
||||
end_frame = min(end_frame, frames)
|
||||
num_frames = end_frame - start_frame
|
||||
|
||||
if "waveform" in file:
|
||||
data = file["waveform"][:, start_frame:end_frame]
|
||||
|
||||
Reference in new issue
Block a user