Member Junction
    Preparing search index...

    AnalyserNode-backed audio meter. Use the static factories — they are defensive (return null where Web Audio is unavailable) and encode the two ownership modes: stream meters own a private AudioContext; graph meters tap a context the caller owns (and Close never closes it).

    Implements

    Index

    Methods

    • Meters the LOCAL microphone. Identical to ForStream EXCEPT it taps a CLONE of the mic's audio track(s), not the track(s) themselves.

      Why the clone matters: the WebRTC realtime drivers add the mic track to an RTCPeerConnection (pc.addTrack). Once a local track feeds the WebRTC pipeline, Chromium reads pure SILENCE from a parallel MediaStreamAudioSourceNode over the SAME track — so the "Listening" meter never moves while the user speaks even though the mic is live. A cloned track is independent of the PC sender and meters reliably; it is stopped in Close. Harmless for the WS drivers (the clone is just an extra short-lived track). Returns null when Web Audio / the stream has no usable audio track.

      Parameters

      • stream: MediaStream

      Returns RealtimeAudioMeter

    • Meters a MediaStream (e.g. a remote WebRTC stream) via a private AudioContext. Returns null when Web Audio / the stream isn't usable (tests, SSR, stopped tracks) — callers treat null as "no metering available". For the LOCAL microphone use ForMicStream instead.

      Parameters

      • stream: MediaStream

      Returns RealtimeAudioMeter