I made this code to get the duration of all the mp3 files in a folder, but it gives me an error:
import os
from mutagen.mp3 import MP3
path = "D:/FILE/P. F. Ford - A Body on the Beach/"
filenames = next(os.walk(path, topdown=True))
for filename in filenames:
audio = MP3(filename)
print(audio.info.length)
the error:
Traceback (most recent call last):
File "C:\Desktop\.venv\lib\site-packages\mutagen\_util.py", line 251, in _openfile
fileobj = open(filename, "rb+" if writable else "rb")
PermissionError: [Errno 13] Permission denied: 'D:/FILE/P. F. Ford - A Body on the Beach/'
i have all the permissions, can you point me to the right path?