Hi @pqyt,
I was reading this post here:
https://hydrogenaud.io/index.php/topic,126042.msg1046430.html#msg1046430
and I thought I would post my question in this thread.
Does foo_vis_spectrum_analyzer supports an interface between your component and JavaScript to read
the left and right channels and peaks via ActiveX in realtime?
I am using the old foo_vis_vumeter component as @Julero has posted and it reads
the left and right channels and peaks without even the need of a panel with the foo_vis_vumeter component being displayed.
I have a custom peakmeter bar and it feeds the data like this:
/** Indicates if the foo_vis_vumeter component is installed. */
VUMeter: utils.CheckComponent('foo_vis_vumeter')
if (Component.VUMeter) {
this.VUMeter = new ActiveXObject('VUMeter');
}
/**
* Calculates the decibel (dB) value of the given volume.
* @type {Function}
* @private
*/
this.toDecibel = (Level) => Math.round(2000 * Math.log(Level) / Math.LN10) / 100;
// * Set and monitor volume level/peaks from VUMeter
this.leftLevel = this.toDecibel(this.VUMeter.LeftLevel);
this.leftPeak = this.toDecibel(this.VUMeter.LeftPeak);
this.rightLevel = this.toDecibel(this.VUMeter.RightLevel);
this.rightPeak = this.toDecibel(this.VUMeter.RightPeak);
// * Debug stuff
DebugLog('LEFT PEAKS: ', this.leftPeak, ' RIGHT PEAKS: ', this.rightPeak);
DebugLog('LEFT LEVEL: ', this.leftLevel, ' RIGHT LEVEL: ', this.rightLevel, '\n\n');
// Outputs:
LEFT PEAKS: -12.86 RIGHT PEAKS: 0.36
LEFT LEVEL: -13.89 RIGHT LEVEL: -0.46
LEFT PEAKS: 1.67 RIGHT PEAKS: 2.85
LEFT LEVEL: -1.88 RIGHT LEVEL: 1.4
LEFT PEAKS: 4.92 RIGHT PEAKS: 5
LEFT LEVEL: 0.28 RIGHT LEVEL: 2.18
LEFT PEAKS: 2.23 RIGHT PEAKS: 3.08
LEFT LEVEL: 2.01 RIGHT LEVEL: 3.03
Can this be achieved also with your foo_vis_spectrum_analyzer component?
It would be great if this could be done because I need a replacement and want to ditch the old foo_vis_vumeter...
-TT