Constructor
new Meter(container, audioContext, oopt)
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
container |
object | DOM container for the widget. | ||||||||||||||||
audioContext |
AudioContext | The audio context to be used. | ||||||||||||||||
o |
object |
<optional> |
Options object.
Properties
|
Methods
_calcAmplitude(buffer)
Calculate the amplitude for a given audio buffer
Parameters:
| Name | Type | Description |
|---|---|---|
buffer |
Float32Array |
_calcPeak()
Calculate the current peak
_initAudioModules(audioCtx)
Initialize the audio modules necessary to analyse the volume.
Parameters:
| Name | Type | Description |
|---|---|---|
audioCtx |
AudioContext | The audio context to use. |
(private) _initCanvasElements()
Initialize the canvas elements.
(private) _initOptions()
Initialize the options.
(private) _update()
Update (redraw) component based on state.
receiveAudioFrom(audioSource)
Recieve audio from a source.
Parameters:
| Name | Type | Description |
|---|---|---|
audioSource |
AudioNode | The audio source to connect. |