The Assets class provides a cross-platform interface to access
@@ -287,9 +288,7 @@ class Assets
private static function isValidAudio(buffer:AudioBuffer):Bool
{
- // TODO: Check disposed
-
- return buffer != null;
+ return (buffer != null && !buffer.__isDisposed);
}
private static function isValidImage(image:Image):Bool
From e5edbd5bcd5b96a1e7ae1d0f763d7006eb905d54 Mon Sep 17 00:00:00 2001
From: Ralty <78720179+Raltyro@users.noreply.github.com>
Date: Sun, 5 Apr 2026 20:28:36 +0700
Subject: [PATCH 09/10] Lime 8.4.0-dev compatibility
---
src/lime/media/AudioBuffer.hx | 90 ++++++++++++++++++++++++++++++++
src/lime/utils/AssetLibrary.hx | 71 +++++++++++++++++++++++++
src/lime/utils/Assets.hx | 95 ++++++++++++++++++++++++++++++++++
3 files changed, 256 insertions(+)
diff --git a/src/lime/media/AudioBuffer.hx b/src/lime/media/AudioBuffer.hx
index 6ee3844cf5..ed6896f305 100644
--- a/src/lime/media/AudioBuffer.hx
+++ b/src/lime/media/AudioBuffer.hx
@@ -303,6 +303,18 @@ class AudioBuffer
return null;
}
+ /**
+ NOTE: This is here solely because for Lime 8.4.0-dev compatibility.
+ Creates a streamed `AudioBuffer` from a `Bytes` object.
+
+ @param bytes The `Bytes` object containing the compressed audio data.
+ @return An `AudioBuffer` configured for streamed playback when supported.
+ **/
+ public inline static function fromBytesStream(bytes:Bytes):AudioBuffer
+ {
+ return fromBytes(bytes, true);
+ }
+
/**
Native target only.
Creates an 'AudioBuffer' from a 'AudioDecoder' object.
@@ -381,6 +393,18 @@ class AudioBuffer
return null;
}
+ /**
+ NOTE: This is here solely because for Lime 8.4.0-dev compatibility.
+ Creates a streamed `AudioBuffer` from a file.
+
+ @param path The file path to the audio data.
+ @return An `AudioBuffer` configured for streamed playback when supported.
+ **/
+ public inline static function fromFileStream(path:String):AudioBuffer
+ {
+ return fromFile(path, true);
+ }
+
/**
Creates an `AudioBuffer` from an array of file paths.
@@ -415,6 +439,18 @@ class AudioBuffer
#end
}
+ /**
+ NOTE: This is here solely because for Lime 8.4.0-dev compatibility.
+ Creates a streamed `AudioBuffer` from an array of file paths.
+
+ @param paths An array of file paths to search for audio data.
+ @return An `AudioBuffer` configured for streamed playback when supported.
+ **/
+ public inline static function fromFilesStream(paths:Array