Constructor

ResonanceAudio

new ResonanceAudio(context, options)

Main class for managing sources, room and listener models.

Parameter

context

AudioContext

Associated AudioContext.

options

ResonanceAudio~ResonanceAudioOptions

Options for constructing a new ResonanceAudio scene.

Properties

ambisonicInput

AudioNode

Ambisonic (multichannel) input AudioNode (For rendering input soundfields).

ambisonicOutput

AudioNode

Ambisonic (multichannel) output AudioNode (For allowing external rendering / post-processing).

output

AudioNode

Binaurally-rendered stereo (2-channel) output AudioNode.

Methods

createSource

createSource(options) returns Source

Create a new source for the scene.

Parameter

options

Source~SourceOptions

Options for constructing a new Source.

Returns

Source 

setAmbisonicOrder

setAmbisonicOrder(ambisonicOrder)

Set the scene's desired ambisonic order.

Parameter

ambisonicOrder

Number

Desired ambisonic order.

setListenerFromMatrix

setListenerFromMatrix(matrix)

Set the listener's position and orientation using a Three.js Matrix4 object.

Parameter

matrix

Object

The Three.js Matrix4 object representing the listener's world transform.

setListenerOrientation

setListenerOrientation(forwardX, forwardY, forwardZ, upX, upY, upZ)

Set the source's orientation using forward and up vectors.

Parameter

forwardX

Number

forwardY

Number

forwardZ

Number

upX

Number

upY

Number

upZ

Number

setListenerPosition

setListenerPosition(x, y, z)

Set the listener's position (in meters), where origin is the center of the room.

Parameter

x

Number

y

Number

z

Number

setRoomProperties

setRoomProperties(dimensions, materials)

Set the room's dimensions and wall materials.

Parameter

dimensions

Object

Room dimensions (in meters).

materials

Object

Named acoustic materials per wall.

setSpeedOfSound

setSpeedOfSound(speedOfSound)

Set the speed of sound.

Parameter

speedOfSound

Number

Abstract type

ResonanceAudioOptions

inner

Object

Options for constructing a new ResonanceAudio scene.

Properties

Parameter

ambisonicOrder

Number

Desired ambisonic Order. Defaults to DEFAULT_AMBISONIC_ORDER.

listenerPosition

Float32Array

The listener's initial position (in meters), where origin is the center of the room. Defaults to DEFAULT_POSITION.

listenerForward

Float32Array

The listener's initial forward vector. Defaults to DEFAULT_FORWARD.

listenerUp

Float32Array

The listener's initial up vector. Defaults to DEFAULT_UP.

dimensions

Utils~RoomDimensions

Room dimensions (in meters). Defaults to DEFAULT_ROOM_DIMENSIONS.

materials

Utils~RoomMaterials

Named acoustic materials per wall. Defaults to DEFAULT_ROOM_MATERIALS.

speedOfSound

Number

(in meters/second). Defaults to DEFAULT_SPEED_OF_SOUND.