Resonance Audio Unity SDK API Reference
ResonanceAudio
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 |
Options for constructing a new Source. |
- Returns
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
Object
Options for constructing a new ResonanceAudio scene.
Properties
Parameter |
|
---|---|
ambisonicOrder |
Number Desired ambisonic Order. Defaults to
|
listenerPosition |
Float32Array The listener's initial position (in meters), where origin is the center of the room. Defaults to |
listenerForward |
Float32Array The listener's initial forward vector. Defaults to |
listenerUp |
Float32Array The listener's initial up vector. Defaults to |
dimensions |
Room dimensions (in meters). Defaults to
|
materials |
Named acoustic materials per wall. Defaults to |
speedOfSound |
Number (in meters/second). Defaults to
|