Error in audio transcription app using whisper hosted on streamlit cloud

hi, i am currently writing a ai tool which is a audio transcription application and i found this error.

it will be very helpful if someone tells how to solve ffmpeg file not found error. recently i have came across this that u have to give filepath for a file for transcribe() function. if this was on local machine i could have given the path where the audio was stored but on streamlit cloud how can we give the file path of a uploaded audio file?

here is the code…

import streamlit as st
import whisper
st.set_page_config(page_title="chatPdf", page_icon="🧊")
st.title("Audio transciption app")

#upload audio file with streamlit
audio_file = st.file_uploader("Upload Audio", type=["wav","mp3","mp4"])
#importing model -- base(74M pararameter)
model = whisper.load_model("base")
st.info("Whisper model loaded")

st.header("Play audio file:")
st.audio(audio_file)

if st.button("Transcribe Audio"):
    if audio_file is not None:
        st.success("Transcribing Audio")
        transcription = model.transcribe(audio_file.name)
        st.success("Transcription Complete")
        st.markdown(transcription["text"])
    else:
        st.error("Please upload a audio file")

packages.txt

ffmpeg
1 Like

hi franky1 thanks for the help but now there is a new error showing up after i added ffmpeg packages.txt

1 Like

This seems to be a duplicate of these posts:

Going to close this thread for clarity