0.5.3 • Published 4 years ago

aframe-ambisonic-component v0.5.3

Weekly downloads
10
License
MIT
Repository
github
Last release
4 years ago

aframe-ambisonic-component

Version License

An Ambisonic Audio component for A-Frame.

Built on Omnitone.

API

PropertyDescriptionDefault ValueValues
srcThe source of the audio. This can be an HTMLMediaElement (<audio /> or <video />), an ID string pointing to an HTMLMediaElement or a resouce string.
sourcesLoad multiple audio files1. Overrides src.Array of URL strings
loopWhether to loop the element source. Overwrites the value set by the input element.true
useMediaElementWhether to use a media element (required for video). Alternatively, load from source as an audio buffer.true
autoplayWhether to autoplay the element source. Overwrites the value set by the input element.true
modeAudio rendering modeambisoniconeOf(ambisonic, bypass, off)
orderOrder of ambisonic rendering11, 2 or 3
channelMapOrdering of ambisonic component channelsACN[oneOf(ACN), FuMa, SID] or Array of integers

1: Higher-order ambisonic audio requires 9 or 16 channels, but most browsers can only decode 8 channels at a time. So it is necessary to split the audio file into two: each with no more than 8 channels. See Higher Order Ambisonics example.

Installation

Browser

Install and use by directly including the script compiled for the browser:

<head>
  <title>My A-Frame Scene</title>
  <script src="https://aframe.io/releases/1.0.3/aframe.min.js"></script>
  <script src="https://unpkg.com/aframe-ambisonic-component"></script>
</head>

<body>
  <a-scene>
    <a-assets>
      <audio id="audio" src="audiofile.mp4"></audio>
    </a-assets>
    <a-ambisonic src="#audio"></a-entity>
  </a-scene>
</body>

If you already have Omnitone loaded or if you're using another component that loads Omnitone (e.g. aframe-resonance-audio-component), there is a much smaller version of the script that does not include Omnitone.

<script src="https://unpkg.com/aframe-ambisonic-component/build/aframe-ambisonic-component-no-omnitone.min.js"></script>

npm

Install via npm:

npm install aframe-ambisonic-component

Then require and use.

require('aframe');
require('aframe-ambisonic-component');
0.5.3

4 years ago

0.5.2

4 years ago

0.5.0

4 years ago

0.5.1

4 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago