diff --git a/.env.example b/.env.example index a2dda43..981b1bc 100644 --- a/.env.example +++ b/.env.example @@ -58,6 +58,11 @@ POSTGRES_POOL_MAX=10 # Maximum pool connections (default: 10) # === Redis === REDIS_URL=redis://localhost:6379 # Redis connection string (default: redis://localhost:6379) +# === Voice PCM WebSocket (direct gateway→backend, bypasses Redis) === +VOICE_PCM_WS_ENABLED=true # Use direct WS for PCM audio (default: true) +BACKEND_WS_URL=ws://backend:3000/ws # Backend WebSocket URL for gateway PCM streaming +BACKEND_WS_TOKEN= # REQUIRED if VOICE_PCM_WS_ENABLED=true. Internal shared secret + # === Attachments === TELE_UPLOAD_URL=https://upload.asepharyana.my.id/api/upload # Attachment upload endpoint (default) ATTACHMENT_UPLOAD_TIMEOUT_MS=30000 # Upload timeout in ms (default: 30000) diff --git a/services/discord-gateway/src/modules/voice-recording/recorder.ts b/services/discord-gateway/src/modules/voice-recording/recorder.ts index 32c3b63..5775e08 100644 --- a/services/discord-gateway/src/modules/voice-recording/recorder.ts +++ b/services/discord-gateway/src/modules/voice-recording/recorder.ts @@ -141,7 +141,7 @@ export async function startRecording( activeSessions, recordingsDir, pcmSender: _pcmWsClient - ? (pcm, userId) => _pcmWsClient.sendPcm(userId, pcm) + ? (pcm, userId) => _pcmWsClient!.sendPcm(userId, pcm) : undefined, });