ServerConfiguration/Calla/Calla-Lib/js/Calla.CJS.js
/**
     * Creates a spatialzer for an audio source.
     * @private
     * @param {string} id
     * @param {MediaStream|HTMLAudioElement} stream - the audio element that is being spatialized.
     * @param {number} bufferSize - the size of the analysis buffer to use for audio activity detection
     * @return {BaseSource}
     */
Creates a spatialzer for an audio source.
@private
@param {string} id
@param {MediaStream|HTMLAudioElement} stream - the audio element that is being spatialized.
@param {number} bufferSize - the size of the analysis buffer to use for audio activity detection
@return {BaseSource}
Creates a spatialzer for an audio source . @private @param { string } id @param { MediaStream|HTMLAudioElement } stream - the audio element that is being spatialized . @param { number } bufferSize - the size of the analysis buffer to use for audio activity detection @return { BaseSource }
createSpatializer(id, stream, bufferSize) {
        if (!stream) {
            return Promise.reject("No stream or audio element given.");
        }
        else {
            const creator = (resolve) => {
                if (this.listener) {
                    resolve(this.listener.createSource(id, stream, bufferSize, this.audioContext, this.pose.current));
                }
                else {
                    setTimeout(creator, 0, resolve);
                }
            };
            return new Promise(creator);
        }
    }
createSpatializer ( id , stream , bufferSize ) { if ( ! stream ) { return Promise . reject ( "No stream or audio element given." ) ; } else { const creator = ( resolve ) => { if ( this . listener ) { resolve ( this . listener . createSource ( id , stream , bufferSize , this . audioContext , this . pose . current ) ) ; } else { setTimeout ( creator , 0 , resolve ) ; } } ; return new Promise ( creator ) ; } }
Creates a spatialzer for an audio source.
Creates a spatialzer for an audio source .