-
Notifications
You must be signed in to change notification settings - Fork 414
fixed sampling rate issue on compute_fbank_librispeech.py #2060
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -129,6 +129,10 @@ def compute_fbank_librispeech( | |
| recordings=m["recordings"], | ||
| supervisions=m["supervisions"], | ||
| ) | ||
|
|
||
| # Resample audio to 16kHz to match Fbank extractor's expected sampling rate | ||
| logging.info(f"Resampling audio to 16000 Hz") | ||
| cut_set = cut_set.resample(16000) | ||
|
Comment on lines
+134
to
+135
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The sampling rate For example: SAMPLING_RATE = 16000
logging.info(f"Resampling audio to {SAMPLING_RATE} Hz")
cut_set = cut_set.resample(SAMPLING_RATE)Ideally, this constant would be defined at a broader scope (e.g., at the top of the function) and also used when creating the
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you explain which error this is fixing?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AssertionError: Fbank was instantiated for sampling_rate 16000, but sampling_rate=8000 was passed to extract(). There was mismatch in the sampling rate when some audios are not recorded in 16000 Hz
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it your own data? All data from librispeech has a sample rate 16000 Hz.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. well i was using a custom dataset! |
||
|
|
||
| if "train" in partition: | ||
| if bpe_model: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop the unused f-string prefix.
This log line has no placeholders, so the
fprefix is redundant and triggers F541.🔧 Proposed fix
📝 Committable suggestion
🧰 Tools
🪛 Ruff (0.14.13)
134-134: f-string without any placeholders
Remove extraneous
fprefix(F541)
🤖 Prompt for AI Agents