Skip to content
Snippets Groups Projects

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

Merged Pierre Mahe requested to merge bugfix into main
1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
+ 1
1
@@ -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}"
Loading