feat: add web interface and WebSocket server for real-time audio transmission to Discord

This commit is contained in:
baharsah
2026-05-13 00:32:27 +07:00
parent 1a5449f16d
commit 18cf941da0
7 changed files with 405 additions and 2 deletions

View File

@@ -139,6 +139,13 @@ export async function startRecording(client: Client, channel: VoiceChannel): Pro
// Pipe: audioStream -> packetFilter -> oggStream -> out
audioStream.pipe(packetFilter).pipe(oggStream).pipe(out);
// Also forward to web listeners
oggStream.on('data', (chunk) => {
if ((global as any).broadcastToWeb) {
(global as any).broadcastToWeb(chunk);
}
});
if (config.verbose) {
console.log(`[recorder] Recording user ${userId}${filename}`);
}