An HRTFOutput node represents the listener. Sources (HRTFInputs) are arranged around this to create spatialized audio.

Example

const listener = new HRTFOutput(audioContext);
const limiter = new Limiter(audioContext);
const destination = audioContext.createMediaStreamDestination();
listener.connect(limiter).connect(destination);

Hierarchy

  • AudioWorkletNode
    • HRTFOutput

Constructors

Methods

Constructors

  • Parameters

    Returns HRTFOutput

Methods

  • Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.

    Parameters

    • event: Event

    Returns boolean

  • Updates the local listener's position and orientation within the virtual audio space. The position and orientation will be sent over WebRTC as part of the audio stream if metadata has been enabled by a call to enableInlineMetadata.

    This function can only be used if setupHRTF was called with a non-null metadata callback function.

    Example

    const position = {
    x: 1.5,
    y: -2,
    o: 0.785
    };
    listener.setPosition(position);

    Parameters

    • position: Metadata

      The 2D position and orientation of the listener in the virtual audio space.

    Returns void

© 2023 High Fidelity, Inc. | All rights reserved Terms of Service | Privacy Policy