-
Notifications
You must be signed in to change notification settings - Fork 225
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
[Bug] The number of declared samples in the recording diverged from the one obtained when loading audio (offset is 0.0) #1437
Comments
Your manifest seems to be wrong, you say:
but the Recording manifest inside MonoCut says:
The Recording duration should be 48.92 s |
I think MonoCut is correct because I have specified the offset and duration. audio.shape=(1, 782677) should be changed to (1, 79168) |
MonoCut seems OK but the Recording inside has incorrect metadata. You can check with |
check resut: I don't understand why the audio offset is always 0.0, and duration is always None, regardless of the specified offset value.
|
Set the actual duration and num samples of the audio file in the Recording object. Cut is a slice, so the recording must always have full audio metadata. |
Ok.
This problem only occurs when the offset is < 0.00097 and the length of the full audio file is different from the length of the clipped audio file. it's normal when offset >= 0.00097 |
There’s quick-path code optimization when Cut’s start is 0 and duration == Recording.duration that loads the full audio without slicing. Since your metadata is wrong it errors out. When start is nonzero it applies Cut start and duration and manages to load the slice as expected. |
Ok, |
It’s not a bug in Lhotse. I don’t know how you created the Recording object but the issue is likely there somewhere. |
I use nemo project to load lhotse dataset (set use_lhotse=True) |
Can you show the Nemo manifest line for that recording? |
{"audio_filepath": "/a/b/c.wav", "text": "efg", "offset": 0, "duration": 7.755, "sampling_rate": 16000} |
@pzelasko
sample rate: 16k
The total length of the sound file: 48.92 s
Read a segment of the audio file:
offset: 0.0
duration: 4.948
and the following error will occur:
If the offset is set to 0.1, there will be no error messages.
export LHOTSE_AUDIO_DURATION_MISMATCH_TOLERANCE=0.2, can't not resolve it.
How can I solve this problem?
The text was updated successfully, but these errors were encountered: