Initial Commit

This commit is contained in:
2026-05-27 23:47:53 +01:00
parent fbc70f96e6
commit 9b28db724f
18103 changed files with 1600554 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
import type { LevelSample } from "../../session/session-shape/session-shape.types.js";
import { useStreamContextOrThrow } from "../internal/use-stream-context.js";
/**
* Returns realtime peak/RMS for the local microphone (when `peerId` is
* omitted) or for the named peer. Levels come from the peer chain's
* analyzer slot owned by chunks A+B; this hook is a pure projection.
*/
export function useStreamLevels(peerId?: string): LevelSample {
const { session } = useStreamContextOrThrow();
if (peerId === undefined) {
return session.getLocalLevel();
}
return session.getPeerLevel(peerId);
}