HrtfSet
Container for HRTF set.
Constructor Summary
| Public Constructor | ||
| public |
constructor(options: Object) Constructs an HRTF set. |
|
Member Summary
| Public Members | ||
| public set |
coordinateSystem(system: CoordinateSystem): * Set coordinate system for positions. |
|
| public get |
Get coordinate system for positions. |
|
| public get |
Get post-filtering flag. |
|
| public set |
filterAfterLoad(post: Boolean): * Set post-filtering flag. |
|
| public get |
Get coordinate system for filter positions. |
|
| public set |
filterCoordinateSystem(system: CoordinateSystem): * Set coordinate system for filter positions. |
|
| public set |
filterPositions(positions: Array<Coordinates>): * Set filter positions. |
|
| public get |
Get filter positions. |
|
| public get |
Test whether an HRTF set is actually loaded. |
|
| public get |
sofaMetaData: Object: * Get the meta-data from the SOFA URL already loaded. |
|
| public get |
Get the original name of the HRTF set. |
|
| public get |
sofaSampleRate: Number: * Get the original sample-rate from the SOFA URL already loaded. |
|
| public get |
Get the URL used to actually load the HRTF set. |
|
Method Summary
| Public Methods | ||
| public |
Apply filter positions to an existing set of HRTF. |
|
| public |
Export the current HRTF set as a JSON string. |
|
| public |
Load an URL and generate the corresponding set of IR buffers. |
|
| public |
nearest(positionRequest: Coordinates): HrtfSet.nearestType Get the nearest point in the HRTF set, after a successful load. |
|
| public |
nearestFir(positionRequest: Coordinates): AudioBuffer Get the FIR AudioBuffer that corresponds to the closest position in the set. |
|
Public Constructors
public constructor(options: Object) source
Constructs an HRTF set. Note that the filter positions are applied during the load of an URL.
Params:
| Name | Type | Attribute | Description |
| options | Object | ||
| options.audioContext | AudioContext | mandatory for the creation of FIR audio buffers |
|
| options.coordinateSystem | CoordinateSystem |
|
|
| options.filterCoordinateSystem | CoordinateSystem |
|
|
| options.filterPositions | Array<Coordinates> |
|
HrtfSet#filterPositions array of positions to filter. Use undefined to use all positions. |
| options.filterAfterLoad | Boolean |
|
true to filter after full load of SOFA file, instead of multiple partial loading. HrtfSet#filterAfterLoad |
See:
Public Members
public set coordinateSystem(system: CoordinateSystem): * source
Set coordinate system for positions.
public get filterAfterLoad: Boolean: * source
Get post-filtering flag. When false, try to load a partial set of HRTF.
public set filterAfterLoad(post: Boolean): * source
Set post-filtering flag. When false, try to load a partial set of HRTF.
public set filterCoordinateSystem(system: CoordinateSystem): * source
Set coordinate system for filter positions.
Public Methods
public applyFilterPositions() source
Apply filter positions to an existing set of HRTF. (After a successful load.)
This is destructive.
See:
public export(): String source
Export the current HRTF set as a JSON string.
When set, this.filterPositions reduce the actual number of filter, and
thus the exported set. The coordinate system of the export is
this.filterCoordinateSystem.
Throw:
when this.filterCoordinateSystem is unknown. |
public load(sourceUrl: String): Promise.<this | Error> source
Load an URL and generate the corresponding set of IR buffers.
Params:
| Name | Type | Attribute | Description |
| sourceUrl | String |
Return:
| Promise.<this | Error> | resolve when the URL sucessfully loaded. |
public nearest(positionRequest: Coordinates): HrtfSet.nearestType source
Get the nearest point in the HRTF set, after a successful load.
Params:
| Name | Type | Attribute | Description |
| positionRequest | Coordinates |
See:
public nearestFir(positionRequest: Coordinates): AudioBuffer source
Get the FIR AudioBuffer that corresponds to the closest position in the set.
Params:
| Name | Type | Attribute | Description |
| positionRequest | Coordinates |
Return:
| AudioBuffer |