openalsoft audio fix (#552)

Co-authored-by: Smokey <78874128+Smokey555@users.noreply.github.com>
Co-authored-by: Cobalt Bar <79053181+CobaltBar@users.noreply.github.com>
This commit is contained in:
cyn
2025-02-15 16:44:19 +01:00
committed by GitHub
co-authored by Smokey Cobalt Bar
parent 8196103b30
commit 28396e28bb
3 changed files with 51 additions and 0 deletions
@@ -0,0 +1,31 @@
package funkin.backend.system.modules;
import haxe.io.Path;
/*
* A class that simply points OpenALSoft to a custom configuration file when
* the game starts up.
*
* The config overrides a few global OpenALSoft settings with the aim of
* improving audio quality on desktop targets.
*/
@:keepInit class ALSoftConfig
{
#if desktop
static function __init__():Void
{
var origin:String = #if hl Sys.getCwd() #else Sys.programPath() #end;
var configPath:String = Path.directory(Path.withoutExtension(origin));
#if windows
configPath += "/plugins/alsoft.ini";
#elseif mac
configPath = Path.directory(configPath) + "/Resources/plugins/alsoft.conf";
#else
configPath += "/plugins/alsoft.conf";
#end
Sys.putEnv("ALSOFT_CONF", configPath);
}
#end
}