48 lines
1.8 KiB
TypeScript
48 lines
1.8 KiB
TypeScript
export default Directivity;
|
|
/**
|
|
* @class Directivity
|
|
* @description Directivity/occlusion filter.
|
|
* @param {AudioContext} context
|
|
* Associated {@link
|
|
https://developer.mozilla.org/en-US/docs/Web/API/AudioContext AudioContext}.
|
|
* @param {Object} options
|
|
* @param {Number} options.alpha
|
|
* Determines directivity pattern (0 to 1). See
|
|
* {@link Directivity#setPattern setPattern} for more details. Defaults to
|
|
* {@linkcode Utils.DEFAULT_DIRECTIVITY_ALPHA DEFAULT_DIRECTIVITY_ALPHA}.
|
|
* @param {Number} options.sharpness
|
|
* Determines the sharpness of the directivity pattern (1 to Inf). See
|
|
* {@link Directivity#setPattern setPattern} for more details. Defaults to
|
|
* {@linkcode Utils.DEFAULT_DIRECTIVITY_SHARPNESS
|
|
* DEFAULT_DIRECTIVITY_SHARPNESS}.
|
|
*/
|
|
declare class Directivity {
|
|
constructor(context: any, options: any);
|
|
_context: any;
|
|
_lowpass: any;
|
|
_cosTheta: number;
|
|
input: any;
|
|
output: any;
|
|
/**
|
|
* Compute the filter using the source's forward orientation and the listener's
|
|
* position.
|
|
* @param {Float32Array} forward The source's forward vector.
|
|
* @param {Float32Array} direction The direction from the source to the
|
|
* listener.
|
|
*/
|
|
computeAngle(forward: Float32Array, direction: Float32Array): void;
|
|
/**
|
|
* Set source's directivity pattern (defined by alpha), where 0 is an
|
|
* omnidirectional pattern, 1 is a bidirectional pattern, 0.5 is a cardiod
|
|
* pattern. The sharpness of the pattern is increased exponenentially.
|
|
* @param {Number} alpha
|
|
* Determines directivity pattern (0 to 1).
|
|
* @param {Number} sharpness
|
|
* Determines the sharpness of the directivity pattern (1 to Inf).
|
|
* DEFAULT_DIRECTIVITY_SHARPNESS}.
|
|
*/
|
|
setPattern(alpha: number, sharpness: number): void;
|
|
_alpha: number;
|
|
_sharpness: number;
|
|
}
|