Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bugs in MixedCut logic #1073

Merged
merged 6 commits into from
May 26, 2023

Conversation

flyingleafe
Copy link
Contributor

I attempted to simulate some conversations, then cut them into windows and save the resulting cuts on the disk. I have encountered two bugs:

  • IndexError in MixedCut.truncate: happened because the cut window happened to be in the region between MixTracks, so no intersecting tracks were found and such case was not handled;
  • AssertionError in MixedCut.load_audio: the resulting audio length were mismatched, because the offset of the first track in the cut was not accounted for during mixing, resulting in incorrect mix length.

This PR fixes those:

  • returning PaddingCut in the first case;
  • accounting for the base audio offset in the mixer, via providing an extra optional constructor parameter.

@desh2608
Copy link
Collaborator

Can you add a test case which would have failed before this change but is fixed now?

@flyingleafe
Copy link
Contributor Author

@desh2608 yes, added.

Copy link
Collaborator

@pzelasko pzelasko left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM!

@pzelasko pzelasko added this to the v1.15 milestone May 26, 2023
@pzelasko pzelasko enabled auto-merge (squash) May 26, 2023 21:31
@pzelasko pzelasko merged commit d430776 into lhotse-speech:master May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants