cacophony
    Preparing search index...

    Interface MicrophoneStreamOptions

    Options for acquiring and monitoring a microphone stream.

    interface MicrophoneStreamOptions {
        constraints?: MediaStreamConstraints;
        panType?: PanType;
        primeWithMediaElement?: boolean;
        stereoPan?: number;
        stopTracksOnStop?: boolean;
        threeDOptions?: Partial<HrtfPannerOptions>;
    }

    Hierarchy (View Summary)

    Index
    constraints?: MediaStreamConstraints

    Constraints forwarded to navigator.mediaDevices.getUserMedia.

    panType?: PanType
    primeWithMediaElement?: boolean

    Attach the stream to a muted HTMLAudioElement while it plays.

    Chromium will not render a remote WebRTC MediaStreamTrack that is only connected to the Web Audio graph: packets arrive but the decoder produces zero samples, so a MediaStreamAudioSourceNode taps pure silence. Pulling the same stream through a media element "primes" the decode pipeline; the Web Audio path then receives real audio. The element is muted so it does not double-play over the (possibly spatialised) Web Audio output. Firefox does not need this, but the priming element is harmless there.

    Defaults to true. Set to false for streams that are never routed to a Web Audio graph, or in environments without HTMLAudioElement.

    stereoPan?: number

    Initial left/right pan when panType is "stereo".

    stopTracksOnStop?: boolean

    Stop the microphone tracks when playback stops or is cleaned up. Defaults to true. Set to false to keep the stream reusable.

    threeDOptions?: Partial<HrtfPannerOptions>

    Initial spatial options when panType is "HRTF" (the default).