import Renderer from '@mobilizing/library/js/Mobilizing/renderer/audio/Renderer.js'
Constructor Summary
Public Constructor | ||
public | constructor(params: Object) |
Member Summary
Public Members | ||
public | analyser: * | |
public | ||
public | ||
public | ||
public | ||
public | audioContext: * | |
public | listener: * | |
public | ||
public | masterGain: * | |
public | sources: *[] |
Method Summary
Public Methods | ||
public | beep(frequency: *) | |
public | createAnalyzer(fftSize: Number, smoothingTimeConstant: Number) creates a webaudioAPI analyzer to extract frequencies from the audio source used in this renderer | |
public | ||
public | getMasterGain(val: Number): * Get this audioContext's gain volume | |
public | registerNode(source: Source) Maintains an array of all the sources attached to this renderer | |
public | setListenerAutoUpdateRotation(value: Boolean) Set the update of the forward and up vector of this audio listener to be automatic (computed from the given 3D object transform) or not (will stay at (0, 0, -1, 0, 1, 0)) | |
public | setListenerPosition(pos: Object | Vector3) Set the position of the listner in 3D space ONLY when transform from a 3D object has not been attached to the listener (cf setListenerTransform()) | |
public | setListenerQuaternion(quaternion: Quaternion) Set the listener orientation through the given Mobilizing/Three.js quaternion. | |
public | setListenerTransform(transform: Transform) Attach a Transform object, usually coming from a 3D graphical object, to this renderer listener (the "ears"). | |
public | setMasterGain(val: Number) Set this audioContext's gain volume, use a 1 sec linear ramp to avoid clicks | |
public | update() |
Inherited Summary
From class Component | ||
public | ||
public | context: * | |
public | events: * | |
public | id: * | |
public | name: * | |
private | _nexts: *[] | |
private | ||
public | byPass() | |
public | Adds a component to this chained component array | |
public | Returns the array of attached children components | |
public | off() Deactivate the component | |
public | on() Activate the component A call to this method calls the setup method if it has not been run yet | |
public | Run code after the update of all components is run This empty method is usually overriden to perform post-update actions for the component It is called periodically by an internal Mobilizing mechanism | |
public | preLoad() preLoad the component This empty method is usually overriden to perform preLoad actions for the component. | |
public | Run code before the update of all components is run This empty method is usually overriden to perform pre-update actions for the component It is called once per component by an internal Mobilizing mechanism | |
public | prepare() prepare the component This empty method is usually overriden to perform preparation actions for the component, from external process as a server. | |
public | setup() Set's up the component This empty method is usually overriden to perform setup actions for the component This is where all the initialization (such as adding event listeners)should be done It is called automatically by an internal Mobilizing mechanism and should thus not be called directly | |
public | update() Update the component This empty method is usually overriden to perform update actions for the component It is called periodically by an internal Mobilizing mechanism |
Public Constructors
Public Members
public analyser: * source
Properties:
Name | Type | Attribute | Description |
analyser | * | audio analyser |
public analyserFloatFrequencyArray: * source
public analyserFloatTimeArray: * source
public analyserFrequencyArray: * source
public analyserTimeArray: * source
Properties:
Name | Type | Attribute | Description |
analyserArray | * | Uint8Array for accessing frequencies |
public audioContext: * source
public listener: * source
public listenerAutoUpdateRotation: * source
public masterGain: * source
public sources: *[] source
Public Methods
public beep(frequency: *) source
Params:
Name | Type | Attribute | Description |
frequency | * |
public createAnalyzer(fftSize: Number, smoothingTimeConstant: Number) source
creates a webaudioAPI analyzer to extract frequencies from the audio source used in this renderer
public getMasterGain(val: Number): * source
Get this audioContext's gain volume
Params:
Name | Type | Attribute | Description |
val | Number |
Return:
* |
public registerNode(source: Source) source
Maintains an array of all the sources attached to this renderer
Params:
Name | Type | Attribute | Description |
source | Source |
public setListenerAutoUpdateRotation(value: Boolean) source
Set the update of the forward and up vector of this audio listener to be automatic (computed from the given 3D object transform) or not (will stay at (0, 0, -1, 0, 1, 0))
Params:
Name | Type | Attribute | Description |
value | Boolean |
public setListenerPosition(pos: Object | Vector3) source
Set the position of the listner in 3D space ONLY when transform from a 3D object has not been attached to the listener (cf setListenerTransform())
public setListenerQuaternion(quaternion: Quaternion) source
Set the listener orientation through the given Mobilizing/Three.js quaternion. Directions (i.e forwardVector and upVector) are extracted by the Quaternion Class.
Params:
Name | Type | Attribute | Description |
quaternion | Quaternion | Mobilizing/Three.js quaternion to use for this listener orientation |
public setListenerTransform(transform: Transform) source
Attach a Transform object, usually coming from a 3D graphical object, to this renderer listener (the "ears"). The listener position and orientation (rotation) will be automatically updated against the given Transform.
Params:
Name | Type | Attribute | Description |
transform | Transform |
public setMasterGain(val: Number) source
Set this audioContext's gain volume, use a 1 sec linear ramp to avoid clicks
Params:
Name | Type | Attribute | Description |
val | Number |
public update() source
Update the component This empty method is usually overriden to perform update actions for the component It is called periodically by an internal Mobilizing mechanism