import React from 'react'; import { Volume2, Bell, XCircle } from 'lucide-react'; export const Soundboard: React.FC = () => { const playTone = (freq: number, type: 'sine' | 'square' | 'sawtooth' | 'triangle', duration: number) => { const AudioContext = window.AudioContext || (window as any).webkitAudioContext; if (!AudioContext) return; const ctx = new AudioContext(); const osc = ctx.createOscillator(); const gain = ctx.createGain(); osc.type = type; osc.frequency.setValueAtTime(freq, ctx.currentTime); // Envelope gain.gain.setValueAtTime(0.1, ctx.currentTime); gain.gain.exponentialRampToValueAtTime(0.0001, ctx.currentTime + duration); osc.connect(gain); gain.connect(ctx.destination); osc.start(); osc.stop(ctx.currentTime + duration); }; const playSound = (type: 'DING' | 'BUZZ' | 'THEME') => { if (type === 'DING') { // High pitch double beep playTone(1200, 'sine', 1); setTimeout(() => playTone(1600, 'sine', 1), 100); } else if (type === 'BUZZ') { // Low pitch sawtooth playTone(150, 'sawtooth', 0.8); } else if (type === 'THEME') { // Simple arpeggio jingle [440, 554, 659, 880].forEach((freq, i) => { setTimeout(() => playTone(freq, 'sine', 0.6), i * 150); }); } }; return (