import React, { useEffect, useState } from 'react'; import { motion } from 'framer-motion'; const VoiceVisualizer: React.FC = () => { const [bars, setBars] = useState([]); useEffect(() => { // Create random bars for animation - increased bar count for smoother visualization const barCount = 60; const initialBars = Array.from({ length: barCount }, () => Math.random() * 50 + 10); setBars(initialBars); // Animation interval with smoother transitions const interval = setInterval(() => { setBars(prev => prev.map(() => { // Create more natural voice-like patterns with varying heights return Math.random() * 65 + 5; })); }, 75); // Faster update for smoother animation return () => clearInterval(interval); }, []); return (
{/* Add subtle glow effect in the background */}
{/* Center light glow */}
{bars.map((height, index) => { // Calculate dynamic opacity for better visual effect const opacity = 0.7 + (height / 100) * 0.3; return ( ); })}
); }; export default VoiceVisualizer;