1 year ago

#355788

test-img

Dhouibi iheb

System error when opening Wav File passed as an argument to Fastapi endpoint

As the title states I am trying to pass a path of a wav file to a FastAPI endpoint

The purpose of this program is to convert speech to text using speechbrain, this is a portion of my code

@app.get("/{audio_path:path}")
async def root(audio_path: str):
    instructions..

The error I get :

RuntimeError: Error opening 'favicon.ico': System error.

I tried adding this portion of code :

@app.get('/favicon.ico', include_in_schema=False)
def favicon():
    return FileResponse(favicon_path)

This is the error I get :

OSError: [WinError 1921] The name of the file cannot be resolved by the system: 'favicon.ico'

the wav file name is : test.wav and it is stored in the project directory, I tried the following paths

/test.wav
/D://Projects/speech_Recognizer/test.wav

I had no previous experience with FastAPI so I am wondering if there is anything I've ignored in setting up my api like setting a favicon or something similar..

python

path

wav

fastapi

0 Answers

Your Answer

Accepted video resources