Remove temporary print and prettier

This commit is contained in:
Matthew Stratford 2020-05-22 22:47:59 +01:00
parent 07983e2ff3
commit dfde5d7426

View file

@ -30,7 +30,6 @@ export function VUMeter(props: VUMeterProps) {
const animate = () => { const animate = () => {
if (!isMic || isMicOpen) { if (!isMic || isMicOpen) {
const result = audioEngine.getLevel(props.source); const result = audioEngine.getLevel(props.source);
console.log(result);
setPeak(result); setPeak(result);
rafRef.current = requestAnimationFrame(animate); rafRef.current = requestAnimationFrame(animate);
} }
@ -88,7 +87,8 @@ export function VUMeter(props: VUMeterProps) {
ctx.fillStyle = "#e8d120"; ctx.fillStyle = "#e8d120";
} }
const valueOffset = (Math.max(peak, props.range[0]) - props.range[0]) / valueRange; const valueOffset =
(Math.max(peak, props.range[0]) - props.range[0]) / valueRange;
ctx.fillRect(0, 0, valueOffset * width, height - 10); ctx.fillRect(0, 0, valueOffset * width, height - 10);