/** * Proxies for offscreen threejs audio * * @author Josh Field */ import { Event as DispatchEvent } from 'three' import { Object3DProxy, AudioDocumentElementProxy, MessageType, Message, MainProxy } from './MessageQueue' class AudioGainProxy { gain: any; constructor() { this.gain = { value: 0 } } connect() { } // intentionally noop disconnect() { } // intentionally noop } class AudioPannerProxy { gain: any; panningModel = 'HRTF'; refDistance: number; rolloffFactor: number; maxDistance: number; constructor() { this.gain = { value: 0 } } connect() { } // intentionally noop disconnect() { } // intentionally noop } export class AudioObjectProxy extends Object3DProxy { constructor(listener: AudioListenerProxy) { super(); this.type = 'Audio'; this.listener = listener; this.context = listener.context; this.gain = new AudioGainProxy(); this.autoplay = false; this.detune = 0; this.loop = false; this.loopStart = 0; this.loopEnd = 0; this.offset = 0; this.duration = undefined; this.playbackRate = 1; this.isPlaying = false; this.hasPlaybackControl = true; this.source = null; this.sourceType = 'empty'; this.filters = []; } getOutput() { return; } setNodeSource(audioNodeProxyID) { this.__callFunc('setNodeSource', audioNodeProxyID); return this; } // HTMLMediaElement -