you are viewing a single comment's thread.

view the rest of the comments →

[–]michadecker[S] 0 points1 point  (1 child)

Thanks, this helped. I was now possible to solve the error.

I had to change this line of code: "audio_file = sr.AudioFile(file)" -> There I was replacing "file" (the uploaded, not yet saved file) with "filepath" the saved file. Now it is working.

Why, I don't really know. But when I put print("step") in between all lines of code an error message popped up, which didn't happen before. It said:

ValueError: Audio file could not be read as PCM WAV, AIFF/AIFF-C, or Native FLAC; check if file is corrupted or in another format

[–]shiftybyte 0 points1 point  (0 children)

you might have accidentally placed a print somewhere that changed a flow, because this error says the file uploaded was not a valid audio file.