RTCForge API Reference v1.1.1
    Preparing search index...

    Function getUserMediaWithOptions

    • Convenience wrapper over getUserMedia that exposes common audio processing constraints without the full MediaStreamConstraints shape. Audio and video each default to false (disabled) when omitted.

      Parameters

      • opts: {
            audio?: {
                autoGainControl?: boolean;
                echoCancellation?: boolean;
                noiseSuppression?: boolean;
                sampleRate?: number;
            };
            video?: boolean
            | MediaTrackConstraints;
        }

        Audio processing flags and/or video constraints.

        • Optionalaudio?: {
              autoGainControl?: boolean;
              echoCancellation?: boolean;
              noiseSuppression?: boolean;
              sampleRate?: number;
          }

          Audio capture with optional echo cancellation, noise suppression, auto gain control, and sample rate.

        • Optionalvideo?: boolean | MediaTrackConstraints

          Video constraints, or a boolean to enable/disable video.

      Returns Promise<MediaStream>

      The captured local media stream.

      const stream = await getUserMediaWithOptions({
      audio: { echoCancellation: true, noiseSuppression: true },
      video: true,
      })