65 lines
2.3 KiB
TypeScript
65 lines
2.3 KiB
TypeScript
export default Encoder;
|
|
/**
|
|
* @class Encoder
|
|
* @description Spatially encodes input using weighted spherical harmonics.
|
|
* @param {AudioContext} context
|
|
* Associated {@link
|
|
https://developer.mozilla.org/en-US/docs/Web/API/AudioContext AudioContext}.
|
|
* @param {Object} options
|
|
* @param {Number} options.ambisonicOrder
|
|
* Desired ambisonic order. Defaults to
|
|
* {@linkcode Utils.DEFAULT_AMBISONIC_ORDER DEFAULT_AMBISONIC_ORDER}.
|
|
* @param {Number} options.azimuth
|
|
* Azimuth (in degrees). Defaults to
|
|
* {@linkcode Utils.DEFAULT_AZIMUTH DEFAULT_AZIMUTH}.
|
|
* @param {Number} options.elevation
|
|
* Elevation (in degrees). Defaults to
|
|
* {@linkcode Utils.DEFAULT_ELEVATION DEFAULT_ELEVATION}.
|
|
* @param {Number} options.sourceWidth
|
|
* Source width (in degrees). Where 0 degrees is a point source and 360 degrees
|
|
* is an omnidirectional source. Defaults to
|
|
* {@linkcode Utils.DEFAULT_SOURCE_WIDTH DEFAULT_SOURCE_WIDTH}.
|
|
*/
|
|
declare class Encoder {
|
|
constructor(context: any, options: any);
|
|
_context: any;
|
|
input: any;
|
|
_channelGain: any[];
|
|
_merger: any;
|
|
output: any;
|
|
_azimuth: any;
|
|
_elevation: any;
|
|
/**
|
|
* Set the desired ambisonic order.
|
|
* @param {Number} ambisonicOrder Desired ambisonic order.
|
|
*/
|
|
setAmbisonicOrder(ambisonicOrder: number): void;
|
|
_ambisonicOrder: number;
|
|
/**
|
|
* Set the direction of the encoded source signal.
|
|
* @param {Number} azimuth
|
|
* Azimuth (in degrees). Defaults to
|
|
* {@linkcode Utils.DEFAULT_AZIMUTH DEFAULT_AZIMUTH}.
|
|
* @param {Number} elevation
|
|
* Elevation (in degrees). Defaults to
|
|
* {@linkcode Utils.DEFAULT_ELEVATION DEFAULT_ELEVATION}.
|
|
*/
|
|
setDirection(azimuth: number, elevation: number): void;
|
|
/**
|
|
* Set the source width (in degrees). Where 0 degrees is a point source and 360
|
|
* degrees is an omnidirectional source.
|
|
* @param {Number} sourceWidth (in degrees).
|
|
*/
|
|
setSourceWidth(sourceWidth: number): void;
|
|
_spreadIndex: number;
|
|
}
|
|
declare namespace Encoder {
|
|
/**
|
|
* Validate the provided ambisonic order.
|
|
* @param {Number} ambisonicOrder Desired ambisonic order.
|
|
* @return {Number} Validated/adjusted ambisonic order.
|
|
* @private
|
|
*/
|
|
function validateAmbisonicOrder(ambisonicOrder: number): number;
|
|
}
|