Quefumas / gensound

Pythonic audio processing and generation framework
Apache License 2.0
80 stars 6 forks source link

Find available IO interfaces when compiled using PyInstaller #29

Open Quefumas opened 2 years ago

Quefumas commented 2 years ago

As discussed here #28, gensound can't figure out which libraries are available for I/O when compiled using PyInstaller. (This can be attested by running from gensound.io import IO; IO.status(True) and seeing which options are available)

A good solution for now is to call IO.set_io once at the start of the script, which will make gensound use the provided method even if it thinks it's unavailable. For example: IO.set_io('play', 'pygame') (Read more).

Maybe we can detect installed libraries better using PyInstaller Hooks. Also, I imagine there are other ways to do this as well, without actually importing everything.