• Call setupHRTF to load and initialize WASM modules

    Example

    function remoteSourceMoved(uid, x, y, o) {
    // ...
    }

    enableInlineMetadata(true);
    await setupHRTF(audioContext, remoteSourceMoved);
    let listener = new HRTFOutput(audioContext);
    let limiter = new Limiter(audioContext);
    let dst = audioContext.createMediaStreamDestination();
    listener.connect(limiter).connect(dst);
    let audioElement = new Audio();
    audioElement.srcObject = dst.stream;
    audioElement.play();

    Parameters

    • audioContext: AudioContext

      The AudioContext to use. It should be created with a sample rate of 48000.

    • setRemoteSourcePositionUpdate: Function

      A callback function for when remote Sources change their position. The callback takes parameters (uid : string, x : number, y : number, o : number). The uid is from a previous call to setupReceiverMetadata. x and y are in meters, o is in radians.

    Returns Promise<void>

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