File size: 362 Bytes
5d20072
dea462a
 
 
5d20072
 
 
 
d344ece
 
 
dea462a
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import streamlit as st
import whisper

model = whisper.load_model("base")

audio_value = st.experimental_audio_input("Record a voice message")

if audio_value:
    with open("user_sing.mp3", "wb") as f:
        f.write(audio_value.getbuffer())

    user_lyrics = model.transcribe("user_sing.mp3")["text"]
    st.write(user_lyrics)
    # st.audio("user_sing.mp3")