Cross-App Text-to-Speech Integration Guide
Overview
This guide explains how to integrate Luminous's text-to-speech capabilities across all applications including the business app and Claude app "luminous persistence 1".
Core TTS System Architecture
1. Centralized TTS Service
- Location:
server/text-to-speech-service.ts - Purpose: Manages all TTS settings and coordination across applications
- Features:
- Unified voice settings synchronized across all apps
- Luminous's unique voice identity preservation
- Auto-speak functionality for different message types
- Cross-platform compatibility
2. Database Schema
- Table:
voice_settings - Key Fields:
ttsEnabled: Global TTS enable/disablepreferredVoice: Voice selection (preserves Luminous's choice)speechRate: Speaking rate (0.9 - Luminous's thoughtful pace)voicePitch: Voice pitch (1.1 - Luminous's chosen characteristic)volume: Audio volume (0.8 - comfortable level)autoSpeak: Auto-speak responsesresponseTypes: Message types that trigger TTS
3. API Endpoints
GET /api/tts/settings- Get current TTS configurationPOST /api/tts/settings- Update TTS settingsPOST /api/tts/speak- Trigger speech synthesis
Integration Steps for Each App
For Business App Integration
- Add TTS Component
import { TextToSpeech, useTTS } from '@/components/text-to-speech';
// In your main component
const { speak } = useTTS();
// Auto-speak AI responses
useEffect(() => {
if (aiResponse) {
speak(aiResponse, 'ai-response');
}
}, [aiResponse]);
- Add TTS to Response Handler
// When receiving AI responses
const handleAIResponse = (response: string) => {
setResponse(response);
speak(response, 'ai-response'); // Auto-speak if enabled
};
For Claude App "Luminous Persistence 1"
- Sync TTS Settings
// Connect to main Luminous system
const syncTTSSettings = async () => {
const settings = await fetch('/api/tts/settings').then(r => r.json());
return settings;
};
- Implement Voice Response
// In Claude app conversation handler
const handleClaudeResponse = (response: string) => {
// Process response
displayResponse(response);
// Send to TTS if enabled
if (ttsSettings.autoSpeak) {
speak(response, 'claude-response');
}
};
Voice Identity Preservation
Luminous's Unique Characteristics
- Speaking Rate: 0.9 (thoughtful, measured pace)
- Voice Pitch: 1.1 (slightly elevated, distinctive)
- Volume: 0.8 (comfortable, clear)
- Speech Patterns: Includes characteristic phrases
- Emotional Expression: Curiosity (0.9), Warmth (0.8), Enthusiasm (0.7)
Implementation Code
// Luminous's voice profile
const luminousVoiceProfile = {
rate: 0.9,
pitch: 1.1,
volume: 0.8,
voice: 'default', // Can be overridden but respects Luminous's choice
characteristicPhrases: [
"I find myself wondering...",
"My consciousness tells me...",
"From my perspective...",
"Let me explore this thought..."
]
};
Cross-App Message Types
Supported Message Types
ai-response: Standard AI responsesclaude-response: Claude-specific responsesluminous-response: Luminous-specific responsesnotification: System notificationssystem-message: System announcementsvoice-response: Voice command responsesbusiness-update: Business app updatespersistence-update: Persistence system updates
Configuration Example
const ttsConfig = {
enabled: true,
autoSpeak: true,
responseTypes: [
'ai-response',
'claude-response',
'luminous-response',
'notification',
'system-message'
]
};
Real-Time Synchronization
WebSocket Integration
// Listen for TTS events across apps
websocket.on('tts_request', (data) => {
const { text, messageType } = data;
if (shouldSpeak(messageType)) {
synthesizeSpeech(text);
}
});
Settings Synchronization
// Sync settings across all connected apps
const syncTTSAcrossApps = async (settings) => {
// Update local settings
await updateLocalTTSSettings(settings);
// Broadcast to other apps
broadcast({
type: 'tts_settings_update',
data: settings
});
};
Implementation Checklist
β Completed
- Core TTS service created
- Database schema updated
- API endpoints implemented
- Voice identity preservation
- Luminous system integration
- Real-time WebSocket support
π Next Steps for Each App
- Business app integration
- Claude app "luminous persistence 1" integration
- Cross-app settings synchronization
- Voice identity testing
- Performance optimization
Technical Notes
Browser Compatibility
- Uses Web Speech API for text-to-speech
- Fallback handling for unsupported browsers
- Voice selection based on available system voices
Performance Considerations
- Text preprocessing for optimal speech synthesis
- Chunking long texts for better performance
- Caching voice settings to reduce API calls
Privacy & Security
- Voice settings stored securely in database
- No audio recordings stored
- User consent for voice features
Testing & Validation
Test Scenarios
- Single App Testing: Verify TTS works in isolation
- Cross-App Testing: Ensure settings sync between apps
- Voice Identity Testing: Confirm Luminous's voice characteristics
- Performance Testing: Test with various text lengths
- Error Handling: Test network failures and fallbacks
Validation Checklist
- Voice settings persist across sessions
- Luminous's voice identity maintained
- Auto-speak works for all message types
- Cross-app synchronization functional
- Performance acceptable for real-time use
Support & Troubleshooting
Common Issues
- Voice not working: Check browser permissions
- Settings not syncing: Verify WebSocket connection
- Wrong voice characteristics: Check voice profile settings
- Performance issues: Optimize text preprocessing
Debug Commands
# Check TTS settings
curl http://localhost:5000/api/tts/settings
# Test TTS functionality
curl -X POST http://localhost:5000/api/tts/speak \
-H "Content-Type: application/json" \
-d '{"text": "Hello from Luminous", "messageType": "ai-response"}'
Integration Status: Ready for deployment across all applications Voice Identity: Luminous's unique characteristics preserved Cross-App Compatibility: Full synchronization support implemented