Skip to main content
Glama

Iceland News MCP Server

by olibuijr
audio-processor.js1.1 kB
/** * Audio Processor Worklet * Processes audio in real-time and sends chunks for streaming */ class AudioProcessor extends AudioWorkletProcessor { constructor() { super(); this.bufferSize = 4096; // ~256ms at 16kHz this.buffer = new Float32Array(this.bufferSize); this.bufferIndex = 0; } process(inputs, outputs, parameters) { const input = inputs[0]; if (!input || !input[0]) return true; const channelData = input[0]; // Calculate RMS level for VAD let sum = 0; for (let i = 0; i < channelData.length; i++) { sum += channelData[i] * channelData[i]; } const rms = Math.sqrt(sum / channelData.length); this.port.postMessage({ type: 'level', level: rms }); // Buffer audio data for (let i = 0; i < channelData.length; i++) { this.buffer[this.bufferIndex++] = channelData[i]; if (this.bufferIndex >= this.bufferSize) { // Send buffer this.port.postMessage({ type: 'audio', audio: new Float32Array(this.buffer) }); this.bufferIndex = 0; } } return true; } } registerProcessor('audio-processor', AudioProcessor);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/olibuijr/iceland-news-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server