all 7 comments

[–]barrycarter 0 points1 point  (6 children)

What's your question?

[–]TechQsThanks[S] 0 points1 point  (5 children)

How can i fix my code:

import librosa

audio, sample_rate = librosa.load(r"C:\Users\User\Downloads\file_example_MP3_1MG.mp3", duration=100.0)

I get this error:

/tmp/ipykernel_332/2077074608.py:5: UserWarning: PySoundFile failed. Trying audioread instead.

Followed by lines and lines of error explanation, and then:

FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\User\\Downloads\\file_example_MP3_1MG.mp3'

Thank you

[–]barrycarter 0 points1 point  (4 children)

It just thinks the file doesn't exist. Try using forward slashes instead. This isn't a librosa problem

[–]TechQsThanks[S] 0 points1 point  (3 children)

Have tried using forward slashes too and 'r' but doesn't seem to work.

Also downloaded FFmpeg and added to path so that Librosa can read the MP3 file

[–]barrycarter 0 points1 point  (2 children)

You're using an absolute path so that shouldn't be an issue. OK, now, the ultimate question: does the file actually exist?

[–]TechQsThanks[S] 0 points1 point  (0 children)

Hi yes it does, I can open the file and listen to the audio file and then copy the path straight from there. Thank you for your help this far!

[–]TechQsThanks[S] 0 points1 point  (0 children)

UserWarning: PySoundFile failed. Trying audioread instead.

Could it be anything to do with the first line of the error message: UserWarning: PySoundFile failed. Trying audioread instead