Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

AlyssonM
Copy link

Summary

This PR introduces a comprehensive TTS (Text-to-Speech) voice notification system and Claude Code hooks integration to ClaudeCodeUI, providing audio alerts and advanced automation capabilities.

🎤 TTS Voice Notifications

  • Multiple Provider Support: ElevenLabs, Deepgram Aura, OpenAI TTS, and offline pyttsx3
  • Backend Audio Streaming: Server-side audio generation with WebSocket delivery to browser
  • High-Quality Neural Voices: Professional-grade speech synthesis with natural-sounding voices
  • Smart Provider Fallbacks: Automatic fallback from premium services to local synthesis
  • Real-time Configuration: Update TTS settings and API keys through the web interface
  • Personalized Notifications: Configurable engineer name integration with customizable frequency

🔧 Claude Code Hooks Integration

  • Complete Lifecycle Hooks: Pre-tool use, post-tool use, notification, stop, and subagent hooks
  • Security Layer: Automatically blocks dangerous commands (rm -rf, sensitive file access)
  • TTS Integration: Audio notifications when Claude requests user input
  • UV Single-File Scripts: Self-contained Python scripts with embedded dependencies
  • Environment Synchronization: Seamless .env configuration sharing between hooks and UI
  • Audio Streaming Pipeline: Backend TTS generation with WebSocket delivery to browser

🏗️ Technical Implementation

  • Audio Upload API: /api/audio/upload endpoint with range request support
  • Settings Management: Unified TTS configuration with environment sync
  • WebSocket Notifications: Real-time audio delivery to connected clients
  • File Cleanup: Automatic temporary audio file management
  • Comprehensive Testing: Test endpoints for TTS provider validation

📋 Key Features Added

  • Audio notification settings panel in the UI
  • Backend TTS provider selection and configuration
  • Claude Code hooks system with comprehensive logging
  • Environment variable management and synchronization
  • Audio streaming with fallback mechanisms
  • Console log cleanup for better developer experience

🚀 Enhanced User Experience

  • Audio alerts when Claude needs input or completes tasks
  • Professional voice notifications instead of silent waiting
  • Advanced automation through hooks system
  • Better debugging and logging capabilities
  • Mobile-friendly audio playback with unlock detection

Test plan

  • ✅ Install dependencies and start the application
  • ✅ Configure TTS provider API keys in Settings → Audio Notifications
  • ✅ Test audio notifications with different providers (ElevenLabs, Deepgram, OpenAI)
  • ✅ Verify fallback to browser TTS when backend providers fail
  • ✅ Test Claude Code hooks integration with notification scripts
  • ✅ Validate environment variable synchronization between UI and hooks
  • ✅ Check audio file upload and streaming functionality
  • ✅ Verify console log cleanup reduces browser noise
  • ✅ Test mobile audio unlock and playback
  • ✅ Validate security measures and file cleanup

Claude Hooks feature credits to disler!

@AlyssonM
Copy link
Author

image image

@viper151
Copy link
Contributor

@AlyssonM when saving the changes, the server restarts as you are saving the details on .env.
Can you utilize the sqlite database instead and save the information in there?
You can utilize the migrations history for that

@AlyssonM
Copy link
Author

@viper151, Yeap, that's a good improve.

@viper151
Copy link
Contributor

viper151 commented Aug 1, 2025

@AlyssonM let me know once you have made some changes to this

Copy link
Contributor

@viper151 viper151 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlyssonM let me know once you have made some changes to this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants