- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1
Audio
        Josh Stovall edited this page Dec 3, 2020 
        ·
        1 revision
      
    Create an audio source.
var options = {
     file:'/assets/audio/mahsiv.mp3',
     gain: 1,
     loop: true,
     detune: 1200
}
var audio = new XR.Audio(options);See the live demo.
| Name | Type | Default | Options | Description | 
|---|---|---|---|---|
| analyser | bool | false | analyser on or off | |
| file | string | mp3, wav, ogg | source file | |
| gain | float | 1 | 0to1 | audio gain | 
| loop | bool  | false | loop on or off | |
| detune | int  | 1200 | detune amount (100 is a semitone, 1200 is an octave) | |
| rate | int  | 1 | playback speed ( 2is twice as fast) | |
| distance | float  | distace the audio will emit | ||
| rolloff | float  | amount of curve on the frequency roll off | ||
| type | string  | spatial | spatialoromni | type of audio source |