File tree 2 files changed +8
-2
lines changed
AI-and-Analytics/End-to-end-Workloads/LanguageIdentification/Inference
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,10 @@ def main(argv):
121
121
use_entire_audio_file = True
122
122
sample_list = [0 for _ in range (sample_size )]
123
123
else :
124
- sample_list = [random .randint (sample_dur , int (data .waveduration )) - sample_dur for _ in range (sample_size )]
124
+ start_time_list = list (range (sample_size - int (data .waveduration ) + 1 ))
125
+ sample_list = []
126
+ for i in range (sample_size ):
127
+ sample_list .append (random .sample (start_time_list , 1 )[0 ])
125
128
for start in sample_list :
126
129
if use_entire_audio_file :
127
130
newWavPath = data .wavepath
Original file line number Diff line number Diff line change @@ -221,7 +221,10 @@ def main(argv):
221
221
use_entire_audio_file = True
222
222
sample_list = [0 for _ in range (sample_size )]
223
223
else :
224
- sample_list = [random .randint (sample_dur , int (data .waveduration )) - sample_dur for _ in range (sample_size )]
224
+ start_time_list = list (range (sample_size - int (data .waveduration ) + 1 ))
225
+ sample_list = []
226
+ for i in range (sample_size ):
227
+ sample_list .append (random .sample (start_time_list , 1 )[0 ])
225
228
for start in sample_list :
226
229
if use_entire_audio_file :
227
230
newWavPath = data .wavepath
You can’t perform that action at this time.
0 commit comments