%load_ext autoreload
%autoreload 2
import numpy as np
import matplotlib.pyplot as plt
import IPython.display as ipd
from instruments import *
import librosa
from vocoder import *
sr = 44100
w = 2048
h = 512
y = im2sound("drum.png", w, h, hann_window, 10)
import librosa
import librosa.display
D = librosa.stft(y) # STFT of y
S_db = librosa.amplitude_to_db(np.abs(D), ref=np.max)
librosa.display.specshow(S_db)
ipd.Audio(y, rate=sr)