AI Indicator <3

This commit is contained in:
meoware.exe committed 2026-10-11 21:59:04 +11:00
1 parent 0f6c70017c
commit edb5c06315
11 files changed
+196 -151

No files matched your search

+3 -6
View File
@@ -33,10 +33,7 @@ export interface AudioData {
binCount: number;
}
// Connection states
// disconnected - no audio source
// pending - wired but audio isn't detected (track muted / loading)
// live - audio is detected
// Connection states: disconnected, pending (no audio yet), live
export type ConnectionState = "disconnected" | "pending" | "live";
let state: ConnectionState = "disconnected";
let onStateChange: ((state: ConnectionState) => void) | null = null;
@@ -202,13 +199,13 @@ const captureFromEl = (el: HTMLMediaElement): boolean => {
track.removeEventListener("ended", onEnded);
};
// Captured tracks start muted until samples flow; wait for "unmute" instead of guessing.
// Captured tracks start muted, wait for unmute
loggedCaptureFailure = false;
setState(track.muted ? "pending" : "live");
return true;
};
// An element is worth capturing from when it's actually advancing audio.
// Only capture elements that are playing
const isPlayingAudio = (el: HTMLMediaElement): boolean => !el.paused && !el.ended && el.readyState >= 2;
@@ -36,7 +36,7 @@ void main() {
float barMask = smoothstep(0.0, u_gap, cellPos)
* smoothstep(0.0, u_gap, 1.0 - cellPos);
// Hard cut at bottom, soft feather only at the top edge
// Hard bottom, feathered top
float feather = 1.5 / u_resolution.y;
float heightMask = 1.0 - smoothstep(amp - feather, amp + feather, uv.y);