arkrow / PyMusicLooper

A python program for repeating music endlessly and creating seamless music loops, with play/export/tagging support.
https://pypi.org/project/pymusiclooper/
MIT License
249 stars 23 forks source link

problem loading audio #17

Closed freekatet closed 1 year ago

freekatet commented 1 year ago

Hello, I am trying to run PyMusicLooper on a m1 , python 3.9 and I have this error showing: ERROR ###.mp3 could not be loaded. It might not contain valid audio data, or is in an supported format.

which is weird cause I use librosa and this exact same file with other projects with no problem, I tried other formats than mp3 same problem I tried with an url same problem, tho i see the link is being downloaded.

thank you

arkrow commented 1 year ago

If you're getting that error message, then it failed at the librosa.load() function call. Unfortunately, I do not have access to a Mac device, so I cannot provide any direct support, but I've improved the debug flag to help you track down the source of the problem. Try using the latest git version of PyMusicLooper with the --debug flag active (e.g. pymusiclooper --debug export-points --path "track.mp3"), and let me know what error the traceback shows by attaching it here.

freekatet commented 1 year ago

Librosa works well on other project, looks like its coming from taglib , pytaglib. When I reinstall everything into a new environnement. error points to it .. didn't found a fix yet sadly.

import taglib ImportError: dlopen(/Users/frexkatet/.pyenv/versions/3.9.2/lib/python3.9/site-packages/taglib.cpython-39-darwin.so, 0x0002): symbol not found in flat namespace '__ZN6TagLib10StringList6appendERKNS_6StringE'

just commented the tag parts in core.py as I don't need it for now. Rest is working ::)

arkrow commented 1 year ago

This looks like a problem with the pytaglib / taglib binary on M1 Mac devices. To resolve, you will probably need to first uninstall the library (pip uninstall pytaglib) and then force pip to compile the package locally from source using pip install --no-binary :all: pytaglib.

If using pipx, I believe the equivalent command would be pipx runpip pymusiclooper uninstall pytaglib followed by pipx runpip pymusiclooper install --no-binary :all: pytaglib.

As an official workaround, external libraries will be loaded only when needed in the next release, so that rest of the functionalities can still work if an import problem like this one exists.