Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- train_audio_path = '../input/tensorflow-speech-recognition-challenge/train/audio/'
- all_wave = []
- all_label = []
- for label in labels:
- print(label)
- waves = [f for f in os.listdir(train_audio_path + '/'+ label) if f.endswith('.wav')]
- for wav in waves:
- samples, sample_rate = librosa.load(train_audio_path + '/' + label + '/' + wav, sr = 16000)
- samples = librosa.resample(samples, sample_rate, 8000)
- if(len(samples)== 8000) :
- all_wave.append(samples)
- all_label.append(label)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement