From 0eb4effeb36bd0557d5dbca0dfc35af9351d750b Mon Sep 17 00:00:00 2001 From: LeenkxTeam Date: Thu, 23 Jan 2025 15:52:00 +0000 Subject: [PATCH] Update leenkx/Sources/leenkx/logicnode/AudioLoadNode.hx --- .../Sources/leenkx/logicnode/AudioLoadNode.hx | 52 +++---------------- 1 file changed, 8 insertions(+), 44 deletions(-) diff --git a/leenkx/Sources/leenkx/logicnode/AudioLoadNode.hx b/leenkx/Sources/leenkx/logicnode/AudioLoadNode.hx index 7381269..aa27676 100644 --- a/leenkx/Sources/leenkx/logicnode/AudioLoadNode.hx +++ b/leenkx/Sources/leenkx/logicnode/AudioLoadNode.hx @@ -1,7 +1,6 @@ package leenkx.logicnode; import iron.data.Data; import aura.Aura; -import aura.Assets; class AudioLoadNode extends LogicNode { public var property1: String; @@ -25,53 +24,18 @@ class AudioLoadNode extends LogicNode { return null; } - //var sound = aura.Assets.Sound(name, Uncompress); - //var anotherSound = aura.Assets.Sound("AnotherSoundFile", KeepCompressed); - //var hrtf = aura.Assets.HRTF("myHRTF_mhr"); - + //var loadConfig: AuraLoadConfig = { + // uncompressed: [name], + // compressed: [name], + // hrtf: ["myHRTF_mhr"], + //}; + + Data.getSound(name, function (data) { - //audio = Aura.createUncompBufferChannel(data,inputs[2].get(),Aura.mixChannels[inputs[0].get()]); - var assetList = [ - data, - //anotherSound, - //hrtf, - ]; - - aura.Assets.startLoading(assetList, - - (asset: aura.Assets.Asset, numLoaded: Int, numTotalAssets: Int) -> { - trace('Loaded $numLoadedAssets of $totalNumAssets: ${asset.name}'); - audio = Aura.createUncompBufferChannel(asset,inputs[2].get(),Aura.mixChannels[inputs[0].get()]); - if (numLoaded == totalNumAssets) { - trace("Loaded all assets"); - } - }, - - (asset: aura.Assets.Asset, error: kha.AssetError) -> { - trace('Failed to load asset ${asset.name}. Reason: $error'); - return AbortLoading; - } - ); - + audio = Aura.createUncompBufferChannel(data,inputs[2].get(),Aura.mixChannels[inputs[0].get()]); }); - - - - //Data.getSound(name, function (data) { - // audio = Aura.createUncompBufferChannel(data,inputs[2].get(),Aura.mixChannels[inputs[0].get()]); - //}); return audio; } } } - - - - - In addition to the above change: - - `aura.types.HRTF` was renamed to `aura.types.HRTFData` - - `aura.dsp.panner.HRTFPanner.new()` now expects an `aura.Assets.HRTF` object instead of an `aura.types.HRTFData` object as its second parameter - - `Aura.getSound()` now returns `Null` instead of `Null` - - `Aura.getHRTF()` now returns `Null` instead of `Null` - - `Aura.createUncompBufferChannel()` and `Aura.createCompBufferChannel()` now take an `aura.Assets.Sound` as their first parameter instead of a `kha.Sound` \ No newline at end of file