Add leenkx/Sources/leenkx/logicnode/GetAudioPositionNode.hx

This commit is contained in:
2025-07-03 03:54:54 +00:00
parent 34e0f5a282
commit 863d884b76

View File

@ -0,0 +1,17 @@
package leenkx.logicnode;
import aura.Aura;
import aura.Types;
class GetAudioPositionNode extends LogicNode {
public function new(tree: LogicTree) {
super(tree);
}
override function get(from: Int): Dynamic {
var audio = inputs[0].get();
if (audio == null || audio.channel == null) return 0.0;
return audio.channel.floatPosition / audio.channel.sampleRate;
}
}