Commit Graph

150 Commits

Author SHA1 Message Date
MythEclipse
bc212333d8 feat: implement Tone.js for professional audio transmit and listen
- Replace AudioWorkletNode with Tone.UserMedia for microphone capture
- Use Tone.Analyser for waveform analysis and Tone.Meter for level detection
- Implement proper stereo audio capture with real-time PCM transmission
- Use Tone.context for audio playback with proper buffer handling
- Add Tone.js CDN to HTML template
- Convert dashboard.js to ES module for Tone.js import
- Improve audio quality and reliability with battle-tested library
2026-05-13 22:46:24 +07:00
MythEclipse
bd8e5b78d8 feat: replace ScriptProcessorNode with AudioWorkletNode for transmit
- Create audio-worklet.js with MicrophoneProcessor for audio capture
- Implement noise gate and RMS calculation in worklet
- Send PCM data via MessagePort to main thread
- Update startStreaming to use AudioWorkletNode instead of deprecated ScriptProcessorNode
- Remove WebCodecs decoder complexity from listen
- Keep simple PCM playback for listen feature
2026-05-13 22:40:39 +07:00
MythEclipse
0f30a4aa67 revert: simplify listen to PCM-only, remove WebCodecs complexity
- Remove broadcastOpusToWeb from types and webserver
- Revert recorder to PCM-only broadcast path
- Remove WebCodecs AudioDecoder from dashboard.js
- Simplify WebSocket handler to just play PCM frames
- Remove Howler.js and Tone.js dependencies
- Keep simple AudioContext playback that works reliably
2026-05-13 22:26:59 +07:00
MythEclipse
3dbe3105af fix: simplify AudioData playback with direct copyTo approach
- Rename playAudioData to playAudioDataDirect for clarity
- Remove duplicate playAudioData function with debug logging
- Use direct copyTo into temp Float32Array per channel
- Check isListening state in output callback
2026-05-13 22:20:15 +07:00
MythEclipse
638d5fc005 debug: add logging to AudioData playback
- Log frame count, channels, sample rate from AudioData
- Log destination channel size before copyTo
- Identify frame count mismatch issue
2026-05-13 22:19:25 +07:00
MythEclipse
9066e5b1f2 fix: use Float32Array intermediate for AudioData.copyTo
- AudioData.copyTo requires destination Float32Array, not AudioBuffer channel
- Create temp Float32Array per channel, copyTo into it, then set into AudioBuffer
- Properly handle 48kHz stereo Opus output to AudioContext
2026-05-13 22:17:43 +07:00
MythEclipse
26efaa9e4d fix: correct WebCodecs AudioData.copyTo API and decoder lifecycle
- AudioData.copyTo requires planeIndex parameter per channel
- Check isListening state before decode to prevent closed decoder errors
- Properly close decoder when leaving listen mode
- Queue packets if decoder not ready yet
2026-05-13 22:15:30 +07:00
MythEclipse
25dbd8413b feat: implement WebCodecs Opus decode for browser listen
- Add broadcastOpusToWeb to PcmBroadcaster interface for raw Opus packets
- Server broadcasts Opus frames with mode byte (1) + user hash + packet data
- Browser detects packet mode: mode=1 for Opus, mode=0 for legacy PCM
- Implement WebCodecs AudioDecoder for Opus decoding in browser
- Keep existing PCM playback as fallback for compatibility
- Show error if WebCodecs unsupported
- Fixes listen feature under Bun where native Opus decode unavailable
2026-05-13 22:13:03 +07:00
MythEclipse
251a176b2b feat: remove image handling and update related UI elements for streamlined moderation experience 2026-05-13 21:28:45 +07:00
MythEclipse
95cb8b837a feat(thread-discovery): implement separate endpoint for fetching threads and update channel loading logic 2026-05-13 21:22:05 +07:00
MythEclipse
0b8111de81 feat(moderation): implement backlog message synchronization and enhance message metadata handling 2026-05-13 21:04:45 +07:00
MythEclipse
d55b56c897 feat(moderation): enhance message capture and storage with thread support
- Added functions to retrieve message location, sticker metadata, and display content in messageCapture.ts.
- Updated captureMessage function to store thread information and sticker metadata in the database.
- Modified messageStore.ts to support querying messages and attachments by thread ID.
- Updated types.ts to include thread_id in AttachmentRecord.
- Altered database schema in muxer-queue.ts to add thread_id column to attachments.
- Introduced ChannelSummary interface and listWatchableChannels method in voiceController.ts to fetch watchable channels.
- Added API endpoint in webserver.ts to retrieve channels for a given guild.
2026-05-13 20:52:37 +07:00
MythEclipse
c7d8353403 chore: update devDependencies and add bun-types to tsconfig 2026-05-13 19:49:56 +07:00
MythEclipse
9f09f5ef28 refactor: replace Database type with SqliteDatabase in moderation modules 2026-05-13 19:47:44 +07:00
MythEclipse
471e3bac82 docs: update CLAUDE.md with complete moderation watcher documentation 2026-05-13 19:35:42 +07:00
MythEclipse
6d353c1753 feat: add moderation dashboard UI
- Create responsive dashboard with dark theme
- Implement three tabs: Text Messages, Images, Voice
- Add channel/thread filtering
- Real-time WebSocket updates with polling fallback
- Display message metadata (author, timestamp, edits, deletions)
- Show image previews with upload status and URLs
2026-05-13 19:34:39 +07:00
MythEclipse
692962408f feat: add REST API and WebSocket events for moderation
- Add /api/messages endpoint for querying text and image data
- Add WebSocket broadcast functions for real-time updates
- Support message_created, message_updated, message_deleted events
- Support attachment_uploaded event for real-time image updates
2026-05-13 19:34:15 +07:00
MythEclipse
738f5cfbd6 feat: integrate message capture into bot startup
- Register message capture handlers on bot ready
- Export getDatabase function from muxer-queue
- Initialize database schema for messages and attachments
2026-05-13 19:34:15 +07:00
MythEclipse
b13dfb2ece config: add moderation watcher configuration variables
- Add MONITOR_GUILD_ID for target server monitoring
- Add PICSER_UPLOAD_URL for attachment upload endpoint
- Add attachment upload timeout and size limit settings
- Add retry attempts configuration for upload failures
2026-05-13 19:34:14 +07:00
MythEclipse
017efb0b86 feat: implement moderation message capture system
- Add message store with database operations (insert, update, query)
- Implement attachment uploader with picser integration
- Add Discord event listeners for message create/update/delete
- Support attachment upload with retry logic and error handling
- Add comprehensive unit tests for message store and uploader
2026-05-13 19:34:14 +07:00
MythEclipse
579fcb4684 docs: add moderation watcher expansion design spec 2026-05-13 19:29:01 +07:00
MythEclipse
220c3b93d2 feat: implement Opus decoder runtime checks and add tests for decoder functionality 2026-05-13 18:56:44 +07:00
MythEclipse
4dadcf3871 feat: implement web-driven voice connection with guild/channel selection and API integration 2026-05-13 18:23:20 +07:00
MythEclipse
a5a794c590 feat: implement RMS noise gate and enhance microphone capture settings for improved audio quality 2026-05-13 17:56:08 +07:00
MythEclipse
0e056732bc feat: implement one-port WebSocket server with updated connection handling and configuration 2026-05-13 17:49:33 +07:00
MythEclipse
f9a4b4a92d feat: add muxer job queue with SQLite integration and metrics tracking 2026-05-13 17:06:22 +07:00
MythEclipse
978c2c468d feat: enhance configuration management and add error handling 2026-05-13 16:57:07 +07:00
MythEclipse
673a06376c feat: implement graceful shutdown process for bot
- Added graceful shutdown functionality to handle SIGINT, SIGTERM, uncaught exceptions, and unhandled promise rejections.
- Integrated stopRecording and pause functionality during shutdown.
- Enhanced logging for shutdown steps and error handling.
- Updated package.json to include pino-pretty for improved logging output.
2026-05-13 16:32:14 +07:00
MythEclipse
3ae28157a3 feat: implement logging and retry mechanism with pino and p-retry 2026-05-13 16:25:01 +07:00
MythEclipse
9497e721e0 docs: add env example configuration 2026-05-13 16:05:56 +07:00
MythEclipse
7a5ac2e34a refactor: make hardcoded values configurable via env vars 2026-05-13 16:05:19 +07:00
MythEclipse
48cc83f624 chore: add dist/ to .gitignore 2026-05-13 16:03:06 +07:00
MythEclipse
b4302585c8 chore: add build script 2026-05-13 16:02:16 +07:00
MythEclipse
80081a6f62 refactor: modularize recorder orchestration 2026-05-13 16:00:21 +07:00
MythEclipse
f655daa0c7 style: format recorder modules 2026-05-13 15:56:56 +07:00
MythEclipse
dbe593c6fd refactor: extract recorder domain types and modules 2026-05-13 15:56:42 +07:00
MythEclipse
da108c5d84 refactor: type application config 2026-05-13 15:56:00 +07:00
MythEclipse
d470321321 style: format packetFilter 2026-05-13 15:54:54 +07:00
MythEclipse
138aa397e2 chore: add code quality tooling 2026-05-13 15:28:25 +07:00
MythEclipse
2676998411 chore: add code quality tooling 2026-05-13 15:20:43 +07:00
MythEclipse
29cb2c20c6 docs: add aggressive cleanup design spec 2026-05-13 14:30:32 +07:00
MythEclipse
0957621950 Remove obsolete CRC calculation and OGG file reading tests
- Deleted test-crc.js which contained a custom CRC calculation implementation.
- Removed test-ogg.js that was responsible for reading and displaying OGG files.
2026-05-13 14:18:26 +07:00
MythEclipse
6e67da2192 feat: enhance EventMetadata interface and improve user data handling in recording process 2026-05-13 04:06:37 +07:00
baharsah
aa85dd9beb refactor: implement robust Opus decoding with error-resilient streams and transition to pull-based audio transmission for Discord output 2026-05-13 02:58:11 +07:00
baharsah
ad7dcde47c feat: redesign UI and overhaul audio processing for Discord Gateway v4 2026-05-13 02:30:09 +07:00
baharsah
44ac346c21 refactor: modularize CRC mocking and implement a persistent Ogg stream for web audio playback 2026-05-13 01:12:11 +07:00
baharsah
c911b06b95 feat: implement Opus demuxing for browser streams, cache headers for playback, and enable microphone input in recorder 2026-05-13 01:03:46 +07:00
baharsah
18cf941da0 feat: add web interface and WebSocket server for real-time audio transmission to Discord 2026-05-13 00:32:27 +07:00
root
1a5449f16d init 2026-05-12 19:39:51 +07:00
root
7ad5e58ffa init 2026-05-12 19:38:23 +07:00