Update leenkx/Sources/leenkx/logicnode/AudioLoadNode.hx

This commit is contained in:
LeenkxTeam 2025-01-23 15:52:00 +00:00
parent 238acaad0a
commit 0eb4effeb3

View File

@ -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<aura.Assets.Sound>` instead of `Null<kha.Sound>`
- `Aura.getHRTF()` now returns `Null<aura.Assets.HRTF>` instead of `Null<aura.types.HRTFData>`
- `Aura.createUncompBufferChannel()` and `Aura.createCompBufferChannel()` now take an `aura.Assets.Sound` as their first parameter instead of a `kha.Sound`