Re: Audio wrapper for Python

If it can't find the binary, then there may be an issue with your current working directory. The script your working on has to be in the same directory as the OpenAL binary and the OpenAL.py script, and the script has to consider that folder your working directory to find them. To check what your current working directory is, include this in your script:

print(os.getcwd())

You can change the current working directory with this:

os.chdir(path)

Something like this could also help if you happen to be using pyinstaller, or need to track down the directory the script it working in:

def resource_path(relative_path):
    """ Get absolute path to resource, works for dev and for PyInstaller """
    if hasattr(sys, '_MEIPASS'):
        return os.path.join(sys._MEIPASS, relative_path)

    return os.path.join(os.path.abspath("."), relative_path)
cur = os.getcwd()
path = resource_path('')
os.chdir(path)
-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Turkce_Rap via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Turkce_Rap via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Turkce_Rap via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Turkce_Rap via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Turkce_Rap via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Turkce_Rap via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Turkce_Rap via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Turkce_Rap via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Turkce_Rap via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector

Reply via email to