Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. duration_of_recordings=[]
  2. for label in labels:
  3. waves = [f for f in os.listdir(train_audio_path + '/'+ label) if f.endswith('.wav')]
  4. for wav in waves:
  5. sample_rate, samples = wavfile.read(train_audio_path + '/' + label + '/' + wav)
  6. duration_of_recordings.append(float(len(samples)/sample_rate))
  7.  
  8. plt.hist(np.array(duration_of_recordings))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement