Git Product home page Git Product logo

hifi-spatial-audio-js's Introduction

High Fidelity Spatial Audio

ย 

npm npm

GitHub Workflow Status (event) GitHub issues

Discord Twitter Follow

The High Fidelity Spatial Audio Client Library allows developers to integrate High Fidelity's spatial audio technology into their projects.

Installation

NodeJS

npm i hifi-spatial-audio

Plain Web JavaScript

Import the latest version of the main library with:

<script src="https://hifi-spatial-audio-api.s3-us-west-2.amazonaws.com/releases/latest/HighFidelityAudio-latest.js"></script>

You'll Need a Developer Account

To use the Spatial Audio API, you'll need to sign up for a High Fidelity Developer Account. Sign up for free at account.highfidelity.com.

Documentation

API documentation is available at docs.highfidelity.com.

Examples

You'll find a bunch of examples that make use of this API in the Spatial-Audio-API-Examples GitHub Repository.

Walkthrough Guides

Walkthrough guides of sample applications written in plain Web JavaScript and written in NodeJS are available at highfidelity.com/api/guides.

Release Notes

Release notes for the Spatial Audio Client Library are available on the GitHub releases page.


Super QuickStart - Web JavaScript

Here's a super basic version of how to use the High Fidelity Spatial Audio Client Library in the Web JavaScript context:

<script src="https://hifi-spatial-audio-api.s3-us-west-2.amazonaws.com/releases/latest/HighFidelityAudio-latest.js"></script>
<script>
    // Set up the initial data for our user.
    // They'll be standing at the origin, facing "forward".
    let initialHiFiAudioAPIData = new HighFidelityAudio.HiFiAudioAPIData({
        position: new HighFidelityAudio.Point3D({ "x": 0, "y": 0, "z": 0 }),
        orientation: new HighFidelityAudio.OrientationQuat3D({ "w": 1, "x": 0, "y": 0, "z": 0 })
    });

    // Set up our `HiFiCommunicator` object, supplying our media stream and initial user data.
    let hifiCommunicator = new HighFidelityAudio.HiFiCommunicator({
        initialHiFiAudioAPIData: initialHiFiAudioAPIData
    });
    // `audioMediaStream` is obtained from a separate `getUserMedia()` call.
    await hifiCommunicator.setInputAudioMediaStream(audioMediaStream);

    // Connect to the High Fidelity Audio Spatial API Server by supplying your own JWT here.
    // Follow this guide to get a JWT: https://www.highfidelity.com/api/guides/misc/getAJWT
    // If you don't need a guide, obtain JWT credentials after signing up for a developer account at https://account.highfidelity.com/dev/account
    const HIFI_AUDIO_JWT = "";
    try {
        await hifiCommunicator.connectToHiFiAudioAPIServer(HIFI_AUDIO_JWT);
    } catch (e) {
        console.error(`Error connecting to High Fidelity:\n${e}`);
        return;
    }
</script>

Living on the Edge

If you'd like to use an experimental version of the Spatial Audio Client library built automatically from the tip of the main branch:

NodeJS

npm i hifi-spatial-audio@main

Plain Web JavaScript

Import the experimental version of the main library with:

<script src="https://hifi-spatial-audio-api.s3-us-west-2.amazonaws.com/releases/main/HighFidelityAudio-latest.js"></script>

hifi-spatial-audio-js's People

Contributors

bridie-hifi avatar hd23408 avatar hifibuild avatar howard-stearns avatar luiscuenca avatar rebeccastankus avatar samcake avatar zfox23 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.