Skip to content
Snippets Groups Projects
Commit 87319211 authored by Pierre Mahe's avatar Pierre Mahe
Browse files

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

parent 7807ef5f
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): ...@@ -35,7 +35,7 @@ class Dataset(torch.utils.data.Dataset):
try: try:
info = sf.info(os.path.join(args.audio_folder, fn)) info = sf.info(os.path.join(args.audio_folder, fn))
duration, fs = info.duration, info.samplerate 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: except:
continue continue
assert info.channels > args.channel, f"The desired channel is unavailable for the audio file {fn}" 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