Skip to content

Instantly share code, notes, and snippets.

@aravindpai
Created July 10, 2019 07:24
Show Gist options
  • Save aravindpai/ea0e5614fe1b4e30b78f375846683e3a to your computer and use it in GitHub Desktop.
Save aravindpai/ea0e5614fe1b4e30b78f375846683e3a to your computer and use it in GitHub Desktop.
duration_of_recordings=[]
for label in labels:
waves = [f for f in os.listdir(train_audio_path + '/'+ label) if f.endswith('.wav')]
for wav in waves:
sample_rate, samples = wavfile.read(train_audio_path + '/' + label + '/' + wav)
duration_of_recordings.append(float(len(samples)/sample_rate))
plt.hist(np.array(duration_of_recordings))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment