Update leenkx/Sources/leenkx/logicnode/AudioLoadNode.hx
This commit is contained in:
parent
238acaad0a
commit
0eb4effeb3
@ -1,7 +1,6 @@
|
|||||||
package leenkx.logicnode;
|
package leenkx.logicnode;
|
||||||
import iron.data.Data;
|
import iron.data.Data;
|
||||||
import aura.Aura;
|
import aura.Aura;
|
||||||
import aura.Assets;
|
|
||||||
|
|
||||||
class AudioLoadNode extends LogicNode {
|
class AudioLoadNode extends LogicNode {
|
||||||
public var property1: String;
|
public var property1: String;
|
||||||
@ -25,53 +24,18 @@ class AudioLoadNode extends LogicNode {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
//var sound = aura.Assets.Sound(name, Uncompress);
|
//var loadConfig: AuraLoadConfig = {
|
||||||
//var anotherSound = aura.Assets.Sound("AnotherSoundFile", KeepCompressed);
|
// uncompressed: [name],
|
||||||
//var hrtf = aura.Assets.HRTF("myHRTF_mhr");
|
// compressed: [name],
|
||||||
|
// hrtf: ["myHRTF_mhr"],
|
||||||
|
//};
|
||||||
|
|
||||||
|
|
||||||
Data.getSound(name, function (data) {
|
Data.getSound(name, function (data) {
|
||||||
//audio = Aura.createUncompBufferChannel(data,inputs[2].get(),Aura.mixChannels[inputs[0].get()]);
|
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;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Data.getSound(name, function (data) {
|
|
||||||
// audio = Aura.createUncompBufferChannel(data,inputs[2].get(),Aura.mixChannels[inputs[0].get()]);
|
|
||||||
//});
|
|
||||||
|
|
||||||
return audio;
|
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`
|
|
Loading…
x
Reference in New Issue
Block a user