Use Streamed Music for Freeplay if available

This commit is contained in:
Ralty
2025-08-01 19:03:51 +07:00
parent 9bf7bcefe4
commit 4767bab023
2 changed files with 28 additions and 15 deletions
+2 -2
View File
@@ -241,7 +241,7 @@ class Assets
return null;
}
public static function getMusic(id:String, useCache:Bool = true):Sound
public static function getMusic(id:String, useCache:Bool = true, staticFallback:Bool = true):Sound
{
#if (lime_vorbis && lime > "7.9.0" && !macro)
if (Options.streamedMusic) {
@@ -251,7 +251,7 @@ class Assets
if (vorbisFile != null) return Sound.fromAudioBuffer(AudioBuffer.fromVorbisFile(vorbisFile));
}
#end
return getSound(id, useCache);
return if (staticFallback) getSound(id, useCache); else null;
}
/**