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

Bugfix: code breaks if audio is empty #768

Merged
merged 4 commits into from
Apr 2, 2024

Conversation

Purfview
Copy link
Contributor

@Purfview Purfview commented Mar 31, 2024

Regression since #732 PR [Improve language detection]

Bug can happen if VAD didn't found voice in audio.
Bugfix brings back the previous behaviour on empty audio.

@trungkienbkhn
Copy link
Collaborator

trungkienbkhn commented Apr 2, 2024

@Purfview , thanks for your findings. However, I think that it can revert to its previous behavior with a simple logic outlined below (seek <= content_frames):

while (
    seek <= content_frames
    and seek
    < self.feature_extractor.nb_max_frames * language_detection_segments
)

@Purfview
Copy link
Contributor Author

Purfview commented Apr 2, 2024

Yes, seek <= content_frames is simpler fix, thx.

@nguyendc-systran nguyendc-systran merged commit 8ae82c8 into SYSTRAN:master Apr 2, 2024
3 checks passed
@Purfview Purfview deleted the patch-2 branch April 2, 2024 18:15
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