Extract shared segment_wav into tts_dataset_utils.py - #16209
Open
StarsExpress wants to merge 2 commits into
Open
StarsExpress wants to merge 2 commits into
StarsExpress wants to merge 2 commits into
Conversation
StarsExpress
marked this pull request as ready for review
September 2, 2026 19:21
segment_wav into tts_dataset_utils.py.
Collaborator
|
/ok to test fcf4746 |
StarsExpress
marked this pull request as draft
September 14, 2026 17:31
StarsExpress
force-pushed
the
refactor-ssl-tts
branch
from
September 14, 2026 17:35
a9ee89b to
2242012
Compare
Signed-off-by: Jack Yao <105488074+StarsExpress@users.noreply.github.com>
StarsExpress
force-pushed
the
refactor-ssl-tts
branch
from
September 14, 2026 17:36
2242012 to
b4402a5
Compare
StarsExpress
marked this pull request as ready for review
September 14, 2026 17:39
Author
Signed-off-by: Jack Yao <105488074+StarsExpress@users.noreply.github.com>
segment_wav into tts_dataset_utils.py.segment_wav into tts_dataset_utils.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do ?
Extracted
segment_wavintonemo/collections/tts/parts/utils/tts_dataset_utils.py.Added docstring to explain details of how
segment_wavsplits a waveform into fixed-length, zero-padded segments using a sliding window.Why?
Inside
scripts/ssl_tts, bothmake_supdata.pyandssl_tts_vc.pyduplicate the samesegment_wavfunction for splitting a waveform into PyTorch Tensor segments.By moving this
segment_wavintotts_dataset_utils.py, now these two files can import their sharedsegment_wavwithout risks of drifting from each other.Tests
segment_wavnow lives intts_dataset_utils.py, sotests/.../test_tts_dataset_utils.py::TestTTSDatasetUtilsgains two new test functions:test_segment_wav_pads_short_input— for shorter input that just needs padding.test_segment_wav_sliding_window— for longer input that triggers sliding window.Before your PR is "Ready for review"
Pre checks:
PR Type:
Who can review?
@blisc