Skip to content
Snippets Groups Projects
Commit fe2dba1f authored by Paul Best's avatar Paul Best
Browse files

Merge branch 'bugfix' into 'main'

"bugfix : corrige le calcule des offsets. si len(sig) - args.lensample < 0.01 "

See merge request !1
parents 7807ef5f 87319211
No related branches found
No related tags found
1 merge request!1"bugfix : corrige le calcule des offsets. si len(sig) - args.lensample < 0.01 "
......@@ -35,7 +35,7 @@ class Dataset(torch.utils.data.Dataset):
try:
info = sf.info(os.path.join(args.audio_folder, fn))
duration, fs = info.duration, info.samplerate
self.samples.extend([{'fn':fn, 'offset':offset, 'fs':fs} for offset in np.arange(0, duration+.01 - args.lensample, args.lensample)])
self.samples.extend([{'fn':fn, 'offset':offset, 'fs':fs} for offset in np.arange(0, duration+1e-10 - args.lensample, args.lensample)])
except:
continue
assert info.channels > args.channel, f"The desired channel is unavailable for the audio file {fn}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment