Hifi-Spatial-API-Example-Mansion
Hifi Spatial API Example Mansion - a spooky audio environment featuring:
- The High Fidelity web spatial audio api
- The High Fidelity nodejs spatial audio api
- The High Fidelity RESTful audio environment management api
Usage
Setup
- Install NodeJS v14.15.x
- Install npm
- MacOS: If you encounter admin priviledge errors, add
prefix=/Users/yourusername/.npm-global
to your~/.npmrc
(or another prefix)
- MacOS: If you encounter admin priviledge errors, add
- Run
npm install
in theutils
directory - Run
npm install
in theworker
directory - Create your space on the High Fidelity’s Spatial Audio API Developer Console
- Create a JWT in that space with the username
worker
. - Create a JWT in that space with the username
mansion
. - Create an admin JWT in that space.
- Edit
client\index.html
to setHIFI_AUDIO_JWT
to the JWT you created for the usernamemansion
. - Deploy the
client
directory to your webserver of choice.- For example, to use the node webserver, change to the
client
directory, typenpm install -g http-server
, then typehttp-server
- For example, to use the node webserver, change to the
Install the audio environment
This installs attenuation zones for each room by using the High Fidelity RESTful audio environment management api
- Go into the
utils
directory. - Type
npm run update:zones -- -s <your space id> -j <your admin JWT>
Run the workers
- go into the
workers
directory. - Type
npm run start -- -j <your worker JWT> -n 5
Connect and Play
- Go to the URL to which you deployed the
client
directory. For example, (http://localhost:8080/)
Author
Roxanne Skelly