@hcodes/webhid-ds4
    Preparing search index...

    Control headset microphone hardware gain and capture an explicitly selected OS audio input. The endpoint owns its capture tracks and stops them on stop/reset/controller disconnection. Listen for change, then read stream and call checkSupport again.

    Hierarchy

    • EventTarget
      • DualShock4Microphone
    Index
    • get inputDeviceId(): string | null

      Explicitly selected concrete input, or null before selection/after invalidation.

      Returns string | null

    • get stream(): MediaStream | null

      Current capture, owned by this endpoint. Null when stopped. No recording or playback is automatic.

      Returns MediaStream | null

    • get volume(): number | null

      Last requested microphone HID gain byte (0-255), or null before configuration/after reset. This is a local cache, not hardware readback or browser capture volume.

      Returns number | null

    • set volume(value: number): void

      Parameters

      • value: number

      Returns void

    • Call from an access button. Briefly requests the browser's default microphone to reveal inputs, immediately stops all temporary tracks, and returns concrete inputs for manual selection. Cancels previous pending work/capture, preserving the selected input. Does not retain a stream.

      Returns Promise<MediaDeviceInfo[]>

    • Select a concrete input without capture or a permission prompt. The caller establishes identity. Stops any current capture. Invalid selection clears the old input; system aliases are rejected.

      Parameters

      • deviceId: string

      Returns Promise<void>

    • Set raw headset microphone gain independently of browser capture/permissions. Finite values are clamped to 0-255 and rounded. Resolves when the HID report is sent; rejects on output failure or reset.

      Parameters

      • value: number

      Returns Promise<void>

    • Call from a start button. Capture the selected input using an exact deviceId constraint. Returns one live audio track for WebRTC, Web Audio or MediaRecorder. Replaces previous capture. The endpoint owns the returned tracks: stop/reset/disconnect stops them, even if used elsewhere.

      Returns Promise<MediaStream>

    • Stop owned tracks and cancel pending permission/capture/selection, preserving the selected input.

      Returns void