diff --git a/source/funkin/audio/FunkinSound.hx b/source/funkin/audio/FunkinSound.hx index 0e6bd6893..ba157ed8e 100644 --- a/source/funkin/audio/FunkinSound.hx +++ b/source/funkin/audio/FunkinSound.hx @@ -23,7 +23,7 @@ import openfl.utils.AssetType; @:nullSafety class FunkinSound extends FlxSound implements ICloneable { - static final MAX_VOLUME:Float = 2.0; + static final MAX_VOLUME:Float = 1.0; static var cache(default, null):FlxTypedGroup = new FlxTypedGroup(); @@ -40,7 +40,6 @@ class FunkinSound extends FlxSound implements ICloneable override function set_volume(value:Float):Float { // Uncap the volume. - fixMaxVolume(); _volume = FlxMath.bound(value, 0.0, MAX_VOLUME); updateTransform(); return _volume; @@ -126,18 +125,6 @@ class FunkinSound extends FlxSound implements ICloneable return this; } - function fixMaxVolume():Void - { - return; - #if lime_openal - // This code is pretty fragile, it reaches through 5 layers of private access. - @:privateAccess - var handle = this?._channel?.__source?.__backend?.handle; - if (handle == null) return; - lime.media.openal.AL.sourcef(handle, lime.media.openal.AL.MAX_GAIN, MAX_VOLUME); - #end - } - public override function play(forceRestart:Bool = false, startTime:Float = 0, ?endTime:Float):FunkinSound { if (!exists) return this; diff --git a/source/funkin/ui/debug/charting/handlers/ChartEditorAudioHandler.hx b/source/funkin/ui/debug/charting/handlers/ChartEditorAudioHandler.hx index 363dc1567..5e3ffeb42 100644 --- a/source/funkin/ui/debug/charting/handlers/ChartEditorAudioHandler.hx +++ b/source/funkin/ui/debug/charting/handlers/ChartEditorAudioHandler.hx @@ -299,16 +299,14 @@ class ChartEditorAudioHandler */ public static function playSound(_state:ChartEditorState, path:String, volume:Float = 1.0):Void { - var snd:FlxSound = FlxG.sound.list.recycle(FlxSound) ?? new FlxSound(); var asset:Null = FlxG.sound.cache(path); if (asset == null) { trace('WARN: Failed to play sound $path, asset not found.'); return; } - snd.loadEmbedded(asset); + var snd:FunkinSound = FunkinSound.load(asset); snd.autoDestroy = true; - FlxG.sound.list.add(snd); snd.play(true); snd.volume = volume; }