Skip to content

Commit 28396e2

Browse files
cyn0x8Smokey555CCobaltDev
authored
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>
1 parent 8196103 commit 28396e2

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

alsoft.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[general]
2+
sample-type=float32
3+
stereo-mode=speakers
4+
stereo-encoding=panpot
5+
hrtf=false
6+
cf_level=0
7+
resampler=fast_bsinc24
8+
front-stablizer=false
9+
output-limiter=false
10+
volume-adjust=0
11+
[decoder]
12+
hq-mode=false
13+
distance-comp=false
14+
nfc=false

project.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@
6767
<assets path='mods' rename='mods' embed='false'/>
6868
<assets path='art/readme.txt' rename='do NOT readme.txt' />
6969

70+
<!-- OpenAL config -->
71+
<section if="desktop">
72+
<assets path="alsoft.txt" rename="plugins/alsoft.ini" type="text" if="windows"/>
73+
<assets path="alsoft.txt" rename="plugins/alsoft.conf" type="text" unless="windows"/>
74+
</section>
75+
7076
<!-- ______________________________ Haxedefines _____________________________ -->
7177

7278
<haxeflag name="--macro" value="funkin.backend.system.macros.NewHaxeWarning.warn()" />
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package funkin.backend.system.modules;
2+
3+
import haxe.io.Path;
4+
5+
/*
6+
* A class that simply points OpenALSoft to a custom configuration file when
7+
* the game starts up.
8+
*
9+
* The config overrides a few global OpenALSoft settings with the aim of
10+
* improving audio quality on desktop targets.
11+
*/
12+
@:keepInit class ALSoftConfig
13+
{
14+
#if desktop
15+
static function __init__():Void
16+
{
17+
var origin:String = #if hl Sys.getCwd() #else Sys.programPath() #end;
18+
19+
var configPath:String = Path.directory(Path.withoutExtension(origin));
20+
#if windows
21+
configPath += "/plugins/alsoft.ini";
22+
#elseif mac
23+
configPath = Path.directory(configPath) + "/Resources/plugins/alsoft.conf";
24+
#else
25+
configPath += "/plugins/alsoft.conf";
26+
#end
27+
28+
Sys.putEnv("ALSOFT_CONF", configPath);
29+
}
30+
#end
31+
}

0 commit comments

Comments
 (0)