kcat/openal-soft

Use specific HRTF path

ceski-1 opened this issue · 5 comments

If I understand correctly, the current approach to HRTF enumeration and selection is to follow what's described in the ALC_SOFT_HRTF extension. But this places the burden on the user to configure an alsoft.ini/alsoft.conf file or to locate the default search path, and then manually copy .mhr files there. But what if the application provides its own .mhr files? Is there any way to specify (without using an .ini/.conf) the application's own data path (or on Windows, a subfolder under the .exe location)?

Even if an .ini is created, there's no way to use a path relative to the application directory?

alsoft.ini:

[general]
hrtf-paths = my_relative_folder

alsoft.log:

[ALSOFT] (II) Found hrtf-paths = "my_relative_folder"
[ALSOFT] (II) Searching C:\my_application\*.mhr
[ALSOFT] (II) Searching C:\Users\name\AppData\Roaming\my_relative_folder\*.mhr
[ALSOFT] (II) Searching C:\ProgramData\my_relative_folder\*.mhr
kcat commented

Relative paths in hrtf-paths are treated relative to the AppData\Roaming and ProgramData folders. Beyond that, OpenAL Soft will also search the path specified in the ALSOFT_LOCAL_PATH environment variable (which should preferably be set prior to opening a device, but should be reflected in subsequent enumerations regardless), or the current working directory if that's not set.

Okay, thank you. There's one scenario that can cause problems: If ALSOFT_LOCAL_PATH is set by the application but the user has hrtf-paths set to an absolute path, the application's preference is ignored. There doesn't seem to be a way for the application to override the user/global preference in this case.

kcat commented

Commit eee7eb7 changes this to always search ALSOFT_LOCAL_PATH or the current working directory first.

Thanks again.