Skip to content

Commit

Permalink
attempt to fix file duration error
Browse files Browse the repository at this point in the history
  • Loading branch information
clement-pages committed Jun 20, 2023
1 parent b4d0a78 commit 78718b1
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -520,11 +520,10 @@ def prepare_chunk(self, file_id: int, start_time: float, duration: float, subtas
label_scope = Scopes[self.metadata[file_id]["scope"]]
label_scope_key = f"{label_scope}_label_idx"

#
chunk = Segment(start_time, start_time + duration)

sample = dict()
sample["X"], _ = self.model.audio.crop(file, chunk, duration=duration)
sample["X"], _ = self.model.audio.crop(file, chunk, duration=duration, mode="pad")

# gather all annotations of current file
annotations = self.annotations[self.annotations["file_id"] == file_id]
Expand Down

1 comment on commit 78718b1

@hbredin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I would have advised you to do :)

Please sign in to comment.