Closed TenghuiZhang closed 1 year ago
Also we can make the PR description more useful for reviewers. A list of bullet points that summarizes the nature of changes would be nice.
This is VM-meter UI library recording VM-Meter recording.webm
SInce there is no good RMS npm library to use, I keep my original RMS calculation formula as an individual function.
I am still using the AnalyserNode.getByteFrequencyData() because it is uint8array, instead of floart32array of getFloatFrequencyData(). Uint8array it is easy to calculate with range 0-255.
Reference: https://www.npmjs.com/search?q=keywords:rootMeanSquare https://www.npmjs.com/search?q=keywords:rms
This is the new version UI of VU-meter: Waveform UI.webm
This PR inlcudes the vu-meter library design. It requires the ID of canvas element where the waveform will be rendered and min decibel of for VU-meter as initialization input. minDecibel define the range of vu-meter to consider silent. When the VU-Meter is created, it requires the analyserNode as real-time audio input data for calculating the correct vm-meter library.
The larger decibel means the louder the voice is and vice-verse. The range is from 0 to minDecibel(Is an negative number).
VU-Meter decibels design reference: