Skip to content

Commit

Permalink
Merge pull request mravanelli#48 from rickychanhoyin/master
Browse files Browse the repository at this point in the history
Update speaker_id.py
  • Loading branch information
mravanelli authored Jun 4, 2019
2 parents 86d8042 + 9d17b39 commit 7b2228f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions speaker_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ def create_batches_rnd(batch_size,data_folder,wav_lst,N_snt,wlen,lab_dict,fact_a
snt_len=signal.shape[0]
snt_beg=np.random.randint(snt_len-wlen-1) #randint(0, snt_len-2*wlen-1)
snt_end=snt_beg+wlen

channels = len(signal.shape)
if channels == 2:
print('WARNING: stereo to mono: '+data_folder+wav_lst[snt_id_arr[i]])
signal = signal[:,0]

sig_batch[i,:]=signal[snt_beg:snt_end]*rand_amp_arr[i]
lab_batch[i]=lab_dict[wav_lst[snt_id_arr[i]]]
Expand Down

0 comments on commit 7b2228f

Please sign in to comment.