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 for small segments #57

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Pranjalya
Copy link

Patch

  • Fix for small segments, when the audio duration is less than max_seg_len
  • Fallback for generate_segment_batched in case the seq_len and seq_metadata is not provided

@BBC-Esq
Copy link

BBC-Esq commented May 25, 2024

I like it!

@Sembiance
Copy link

Great fix, without it WhisperS2T is useless for small duration audio.

HIGHLY recommend merging this pull request :)

@shashikg
Copy link
Owner

shashikg commented Jul 6, 2024

Hi @Pranjalya @Sembiance !
Can you describe here or link an issue related to small duration audio?

@Pranjalya
Copy link
Author

Hey @shashikg, the issue was in the loop where we segment audio into parts and the case where the original audio's duration is < 1s. Using the range function and setting the end timestamp as int(audio_duration) will lead it to it being 0, which when used on range returns an empty list. Using a math.ceil function ensures that it is rounded up to the next ceiling integer and the audio segment timestamp is logged.
This bug is potentially dangerous as well if someone is using indexing to map the audio segments, as it leads to missing of the parts.

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.

4 participants