Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. train_audio_path = '../input/tensorflow-speech-recognition-challenge/train/audio/'
  2.  
  3. all_wave = []
  4. all_label = []
  5. for label in labels:
  6. print(label)
  7. waves = [f for f in os.listdir(train_audio_path + '/'+ label) if f.endswith('.wav')]
  8. for wav in waves:
  9. samples, sample_rate = librosa.load(train_audio_path + '/' + label + '/' + wav, sr = 16000)
  10. samples = librosa.resample(samples, sample_rate, 8000)
  11. if(len(samples)== 8000) :
  12. all_wave.append(samples)
  13. all_label.append(label)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement