VolumeMeter
Static Method Summary
| Static Private Methods | ||
| private static |
_getAverageVolume(array: *): * |
|
Constructor Summary
| Public Constructor | ||
| public |
constructor(audioContext: AudioContext, inputStream: MediaStream) Represents a volume meter. |
|
Member Summary
| Public Members | ||
| public |
analyserNode: * |
|
| public |
audioContext: * |
|
| public |
stream: * |
|
| public |
|
|
| public |
|
|
| public |
|
|
Method Summary
| Public Methods | ||
| public |
getVolumeIndication(callback: Function, args: Array) Start analysing the audio stream and provide updates to the specified callback function. |
|
| public |
Start calculating the volume. |
|
| public |
Stop calculating the volume. |
|
| Private Methods | ||
| private |
Calculate the volume, inform listeners by executing the callback. |
|
Static Private Methods
private static _getAverageVolume(array: *): * source
Params:
| Name | Type | Attribute | Description |
| array | * |
Return:
| * |
Public Constructors
public constructor(audioContext: AudioContext, inputStream: MediaStream) source
Represents a volume meter.
Params:
| Name | Type | Attribute | Description |
| audioContext | AudioContext | The WebAudio context. |
|
| inputStream | MediaStream | The MediaStream to analyze. |
Public Members
public analyserNode: * source
public audioContext: * source
public stream: * source
public volumeIndicationCallback: * source
public volumeIndicationCallbackArgs: * source
Public Methods
public getVolumeIndication(callback: Function, args: Array) source
Start analysing the audio stream and provide updates to the specified callback function.
Private Methods
private _updateAnalysers() source
Calculate the volume, inform listeners by executing the callback. Repeat indefinitely.
