Last active
March 15, 2021 06:11
-
-
Save AyishaR/797500f79e82bd35230fe8d0df82f59a 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
#Selecting random index from train dataset | |
ind = int(np.random.uniform()*len(inputs_train)) | |
#Displaying sample spectrogram and audio from train dataset | |
X = inputs_train[ind] | |
y = labels_train[ind].argmax() | |
print("Label :", textLabel(y) ) | |
plt.imshow(X, cmap='hot', interpolation='nearest', aspect='auto') | |
plt.show() | |
audio = librosa.core.istft(X, hop_length=hop_len, win_length=win_len) | |
ipd.Audio(audio, rate=desired_sr, autoplay=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment