WinWut's picture
Update app.py
63365f5
raw
history blame contribute delete
697 Bytes
import streamlit as st
from model import *
st.header("Any songs to Lo-Fi")
x = st.file_uploader("Upload your music")
if x is not None:
wv, sr = librosa.load(x, sr=16000) #Load waveform
print(wv.shape)
speca = prep(wv) #Waveform to Spectrogram
# plt.figure(figsize=(50,1)) #Show Spectrogram
# plt.imshow(np.flip(speca, axis=0), cmap=None)
# plt.axis('off')
# plt.show()
abwv = towave(speca, name='FILENAME7', path='./songs_gen') #Convert and save wav
sample_rate = 44100 # 44100 samples per second
st.audio(abwv, sample_rate=sample_rate)