Created
July 10, 2019 07:25
-
-
Save aravindpai/c9f585ff02564c19908ee88b5eed1a06 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment