Constructor

Utils

new Utils()

A set of defaults, constants and utility functions.

Properties

ATTENUATION_ROLLOFFS

static

Array

Rolloff models (e.g. 'logarithmic', 'linear', or 'none').

DEFAULT_AMBISONIC_ORDER

static

Number

The default ambisonic order.

DEFAULT_ATTENUATION_ROLLOFF

static

string

Default rolloff model ('logarithmic').

DEFAULT_AZIMUTH

static

Number

Default azimuth (in degrees). Suitable range is 0 to 360.

DEFAULT_DIRECTIVITY_ALPHA

static

Number

The default alpha (i.e. microphone pattern).

DEFAULT_DIRECTIVITY_SHARPNESS

static

Number

The default pattern sharpness (i.e. pattern exponent).

DEFAULT_ELEVATION

static

Number

Default elevation (in degres). Suitable range is from -90 (below) to 90 (above).

DEFAULT_FORWARD

static

Float32Array

DEFAULT_MAX_DISTANCE

static

Number

DEFAULT_MIN_DISTANCE

static

Number

DEFAULT_POSITION

static

Float32Array

DEFAULT_REFLECTION_COEFFICIENTS

static

Object

The default reflection coefficients (where 0 = no reflection, 1 = perfect reflection, -1 = mirrored reflection (180-degrees out of phase)).

DEFAULT_REFLECTION_CUTOFF_FREQUENCY

static

Number

The -12dB cutoff frequency (in Hertz) for the lowpass filter applied to all reflections.

DEFAULT_REFLECTION_MAX_DURATION

static

Number

The maximum delay (in seconds) of a single wall reflection.

DEFAULT_REFLECTION_MIN_DISTANCE

static

Number

The minimum distance we consider the listener to be to any given wall.

DEFAULT_REFLECTION_MULTIPLIER

static

Number

The multiplier to apply to distances from the listener to each wall.

DEFAULT_REVERB_BANDWIDTH

static

Number

The default bandwidth (in octaves) of the center frequencies.

DEFAULT_REVERB_DURATION_MULTIPLIER

static

Number

The default multiplier applied when computing tail lengths.

DEFAULT_REVERB_DURATIONS

static

Float32Array

The default multiband RT60 durations (in seconds).

DEFAULT_REVERB_FREQUENCY_BANDS

static

Array

Center frequencies of the multiband late reflections. Nine bands are computed by: 31.25 * 2^(0:8).

DEFAULT_REVERB_GAIN

static

Number

The default gain (linear).

DEFAULT_REVERB_MAX_DURATION

static

Number

The maximum impulse response length (in seconds).

DEFAULT_REVERB_PREDELAY

static

Number

The late reflections pre-delay (in milliseconds).

DEFAULT_REVERB_TAIL_ONSET

static

Number

The length of the beginning of the impulse response to apply a half-Hann window to.

DEFAULT_RIGHT

static

Float32Array

DEFAULT_ROOM_DIMENSIONS

static

Object

Default room dimensions (in meters).

DEFAULT_ROOM_MATERIALS

static

Object

Default materials that use strings from MATERIAL_COEFFICIENTS

DEFAULT_SOURCE_DISTANCE

static

Number

Default distance from listener when setting angle.

DEFAULT_SOURCE_GAIN

static

Number

Default input gain (linear).

DEFAULT_SOURCE_WIDTH

static

Number

The default source width.

DEFAULT_SPEED_OF_SOUND

static

Number

DEFAULT_UP

static

Float32Array

LISTENER_MAX_OUTSIDE_ROOM_DISTANCE

static

Number

Maximum outside-the-room distance to attenuate far-field listener by.

NUMBER_REFLECTION_AVERAGING_BANDS

static

Number

The number of bands to average over when computing reflection coefficients.

NUMBER_REVERB_FREQUENCY_BANDS

static

The number of frequency bands.

ROOM_AIR_ABSORPTION_COEFFICIENTS

static

Float32Array

Air absorption coefficients per frequency band.

ROOM_EYRING_CORRECTION_COEFFICIENT

static

Number

A scalar correction value to ensure Sabine and Eyring produce the same RT60 value at the cross-over threshold.

ROOM_MATERIAL_COEFFICIENTS

static

Object

Pre-defined frequency-dependent absorption coefficients for listed materials. Currently supported materials are:

  • 'transparent'
  • 'acoustic-ceiling-tiles'
  • 'brick-bare'
  • 'brick-painted'
  • 'concrete-block-coarse'
  • 'concrete-block-painted'
  • 'curtain-heavy'
  • 'fiber-glass-insulation'
  • 'glass-thin'
  • 'glass-thick'
  • 'grass'
  • 'linoleum-on-concrete'
  • 'marble'
  • 'metal'
  • 'parquet-on-concrete'
  • 'plaster-smooth'
  • 'plywood-panel'
  • 'polished-concrete-or-tile'
  • 'sheetrock'
  • 'water-or-ice-surface'
  • 'wood-ceiling'
  • 'wood-panel'
  • 'uniform'

ROOM_MIN_VOLUME

static

Number

The minimum threshold for room volume. Room model is disabled if volume is below this value.

ROOM_STARTING_AVERAGING_BAND

static

Number

The starting band to average over when computing reflection coefficients.

SOURCE_MAX_OUTSIDE_ROOM_DISTANCE

static

Number

Maximum outside-the-room distance to attenuate far-field sources by.

Abstract types

RoomDimensions

inner

Object

Properties describing the geometry of a room.

Properties

Parameter

width

Number

(in meters).

height

Number

(in meters).

depth

Number

(in meters).

RoomMaterials

inner

Object

Properties describing the wall materials (from ROOM_MATERIAL_COEFFICIENTS) of a room.

Properties

Parameter

left

String

Left-wall material name.

right

String

Right-wall material name.

front

String

Front-wall material name.

back

String

Back-wall material name.

up

String

Up-wall material name.

down

String

Down-wall material name.