99 lines
3.7 KiB
TypeScript
99 lines
3.7 KiB
TypeScript
export default Utils;
|
|
/**
|
|
* @class Utils
|
|
* @description A set of defaults, constants and utility functions.
|
|
*/
|
|
declare class Utils {
|
|
/**
|
|
* Properties describing the geometry of a room.
|
|
* @typedef {Object} Utils~RoomDimensions
|
|
* @property {Number} width (in meters).
|
|
* @property {Number} height (in meters).
|
|
* @property {Number} depth (in meters).
|
|
*/
|
|
/**
|
|
* Properties describing the wall materials (from
|
|
* {@linkcode Utils.ROOM_MATERIAL_COEFFICIENTS ROOM_MATERIAL_COEFFICIENTS})
|
|
* of a room.
|
|
* @typedef {Object} Utils~RoomMaterials
|
|
* @property {String} left Left-wall material name.
|
|
* @property {String} right Right-wall material name.
|
|
* @property {String} front Front-wall material name.
|
|
* @property {String} back Back-wall material name.
|
|
* @property {String} up Up-wall material name.
|
|
* @property {String} down Down-wall material name.
|
|
*/
|
|
/**
|
|
* ResonanceAudio library logging function.
|
|
* @type {Function}
|
|
* @param {any} Message to be printed out.
|
|
* @private
|
|
*/
|
|
private static log;
|
|
}
|
|
declare namespace Utils {
|
|
const DEFAULT_SOURCE_GAIN: number;
|
|
const LISTENER_MAX_OUTSIDE_ROOM_DISTANCE: number;
|
|
const SOURCE_MAX_OUTSIDE_ROOM_DISTANCE: number;
|
|
const DEFAULT_SOURCE_DISTANCE: number;
|
|
const DEFAULT_POSITION: Float32Array;
|
|
const DEFAULT_FORWARD: Float32Array;
|
|
const DEFAULT_UP: Float32Array;
|
|
const DEFAULT_RIGHT: Float32Array;
|
|
const DEFAULT_SPEED_OF_SOUND: number;
|
|
const ATTENUATION_ROLLOFFS: any[];
|
|
const DEFAULT_ATTENUATION_ROLLOFF: string;
|
|
const DEFAULT_MIN_DISTANCE: number;
|
|
const DEFAULT_MAX_DISTANCE: number;
|
|
const DEFAULT_DIRECTIVITY_ALPHA: number;
|
|
const DEFAULT_DIRECTIVITY_SHARPNESS: number;
|
|
const DEFAULT_AZIMUTH: number;
|
|
const DEFAULT_ELEVATION: number;
|
|
const DEFAULT_AMBISONIC_ORDER: number;
|
|
const DEFAULT_SOURCE_WIDTH: number;
|
|
const DEFAULT_REFLECTION_MAX_DURATION: number;
|
|
const DEFAULT_REFLECTION_CUTOFF_FREQUENCY: number;
|
|
const DEFAULT_REFLECTION_COEFFICIENTS: any;
|
|
const DEFAULT_REFLECTION_MIN_DISTANCE: number;
|
|
const DEFAULT_ROOM_DIMENSIONS: any;
|
|
const DEFAULT_REFLECTION_MULTIPLIER: number;
|
|
const DEFAULT_REVERB_BANDWIDTH: number;
|
|
const DEFAULT_REVERB_DURATION_MULTIPLIER: number;
|
|
const DEFAULT_REVERB_PREDELAY: number;
|
|
const DEFAULT_REVERB_TAIL_ONSET: number;
|
|
const DEFAULT_REVERB_GAIN: number;
|
|
const DEFAULT_REVERB_MAX_DURATION: number;
|
|
const DEFAULT_REVERB_FREQUENCY_BANDS: any[];
|
|
const NUMBER_REVERB_FREQUENCY_BANDS: number;
|
|
const DEFAULT_REVERB_DURATIONS: Float32Array;
|
|
const ROOM_MATERIAL_COEFFICIENTS: any;
|
|
const DEFAULT_ROOM_MATERIALS: any;
|
|
const NUMBER_REFLECTION_AVERAGING_BANDS: number;
|
|
const ROOM_STARTING_AVERAGING_BAND: number;
|
|
const ROOM_MIN_VOLUME: number;
|
|
const ROOM_AIR_ABSORPTION_COEFFICIENTS: Float32Array;
|
|
const ROOM_EYRING_CORRECTION_COEFFICIENT: number;
|
|
const TWO_PI: number;
|
|
const TWENTY_FOUR_LOG10: number;
|
|
const LOG1000: number;
|
|
const LOG2_DIV2: number;
|
|
const DEGREES_TO_RADIANS: number;
|
|
const RADIANS_TO_DEGREES: number;
|
|
const EPSILON_FLOAT: number;
|
|
/**
|
|
* Normalize a 3-d vector.
|
|
* @param {Float32Array} v 3-element vector.
|
|
* @return {Float32Array} 3-element vector.
|
|
* @private
|
|
*/
|
|
function normalizeVector(v: Float32Array): Float32Array;
|
|
/**
|
|
* Cross-product between two 3-d vectors.
|
|
* @param {Float32Array} a 3-element vector.
|
|
* @param {Float32Array} b 3-element vector.
|
|
* @return {Float32Array}
|
|
* @private
|
|
*/
|
|
function crossProduct(a: Float32Array, b: Float32Array): Float32Array;
|
|
}
|