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

The number of declared samples in the recording diverged from the one obtained when loading audio #1437

Open
johnchienbronci opened this issue Dec 13, 2024 · 0 comments

Comments

@johnchienbronci
Copy link

@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:

[Suppressed AudioLoadingError] Error message: The number of declared samples in the recording diverged from the one obtained when loading audio (offset=0.0, duration=4.948). This could be internal Lhotse's error or a faulty transform implementation. Please report this issue in Lhotse and show the following: diff=-703509, audio.shape=(1, 782677), recording=Recording(id='/shorts-20230702.wav_ln25.0', sources=[AudioSource(type='file', channels=[0], source=shorts-20230702.wav')], sampling_rate=16000, num_samples=79168, duration=4.948, channel_ids=[0], transforms=[LoudnessNormalization(target=-25.0)])

[extra info] When calling: Recording.load_audio(args=(Recording(id='shorts-20230702.wav_ln-25.0', so
urces=[AudioSource(type='file', channels=[0], source=shorts-20230702.wav')], sampling_rate=16000, n
um_samples=79168, duration=4.948, channel_ids=[0], transforms=[LoudnessNormalization(target=-25.0)]),) kwargs={'channels': 0, 'offset': 0.0, 'duration': 4.948})        
                                                                                                                                
[extra info] When calling: MonoCut.load_audio(args=(MonoCut(id='shorts-20230702.wav-000000-000495_ln-25.0', start=0.0, duration=4.948, channel=0, supervisions=[SupervisionSegment(id='shorts-20230702.wav-000000-000495_ln-25.0', recording_id='shorts-20230702.wav_ln-25.0', start=0, duration=4.948, channel=0, text='xxxxx', language=None, speaker=None, gender=None, custom={'tokens': array([1272, 1032, 1920, 1032,  198,  202,  996, 2002, 2011, 2009, 1060,                                                                                         
       1941, 1908, 1160, 1945, 1675, 1602, 1137,  996,   12,  844, 1003,                                                                            
         18, 1123, 1955, 1545, 1434, 1064,  996, 2003, 2001, 2003, 2004,                                                                            
       1173, 1521, 1412])}, alignment=None)], features=None, recording=Recording(id='shorts-20230702
.wav_ln-25.0', sources=[AudioSource(type='file', channels=[0], source='shorts-20230702.wav')], sampling_rate=16000, num_samples=79168, duration=4.948, channel_ids=[0], transforms=[LoudnessNormalization(target=-25.0)]), custom={'text': 'xxxxx', 'dataloading_info': {'rank': 0, 'world_size': 1, 'worker_id': None}}),) kwargs={}) 

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?

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

No branches or pull requests

1 participant