Added complete sound effects application with multiple versions (V1, V2), configuration files, webhook functionality, and associated assets. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
5.6 KiB
5.6 KiB
🎵 Sound Effect Generator
A professional web application for generating custom sound effects using the ElevenLabs API with Microsoft Azure AD authentication.
Features
🔐 Authentication
- Microsoft Azure AD Integration: Secure login using Oliver SSO
- Session Management: Persistent login sessions with automatic token validation
- Protected Access: Main application is hidden until user authenticates
🎛️ Sound Generation
- ElevenLabs API Integration: Professional-grade AI sound generation
- Text-to-Sound: Generate sound effects from text descriptions
- Duration Control: Adjustable duration from 0.5 to 22 seconds (or auto)
- Prompt Influence: Fine-tune how closely the AI follows your description (0-1 scale)
🎨 User Interface
- Modern Design: Clean, responsive interface using Montserrat font
- Dark/Light Mode: Toggle between themes with persistent preference storage
- Interactive Sliders: Real-time value display for duration and prompt influence
- Mobile Responsive: Optimized for all device sizes
🔧 Technical Features
- Real-time Audio Playback: Instant preview of generated sounds
- Download Functionality: Save sound effects as MP3 files
- Automatic Cleanup: Old files (24+ hours) are automatically deleted
- Error Handling: Comprehensive error messages and validation
- Security Headers: Protected configuration files and proper MIME types
Installation
Prerequisites
- Web server with PHP support
- ElevenLabs API key
- Microsoft Azure AD application configured
Setup Steps
-
Clone/Download the project files to your web server
-
Configure API Key:
// Edit config.php 'elevenlabs_api_key' => 'your-actual-elevenlabs-api-key-here' -
Set Permissions:
chmod 755 generated/ chmod 644 config.php -
Configure Azure AD (if needed):
- Update
clientIdandauthorityinindex.phpline 500-501 - Ensure redirect URI matches your domain
- Update
Configuration
config.php
return [
'elevenlabs_api_key' => 'your-api-key-here',
'max_file_age_hours' => 24, // Auto-delete files older than this
'generated_files_dir' => 'generated/'
];
Azure AD Settings
Located in index.php around line 498:
const msalConfig = {
auth: {
clientId: "your-client-id",
authority: "https://login.microsoftonline.com/your-tenant-id",
redirectUri: window.location.origin + window.location.pathname
}
};
Usage
- Login: Use your Oliver SSO credentials to authenticate
- Describe Sound: Enter a text description of the sound effect you want
- Adjust Settings:
- Duration: Use slider (0 = auto, or 0.5-22 seconds)
- Prompt Influence: Control AI creativity (0 = creative, 1 = literal)
- Generate: Click "Generate Sound Effect" button
- Play & Download: Preview the audio and download if satisfied
Example Prompts
- "Spacious braam suitable for high-impact movie trailer moments"
- "Gentle rain falling on leaves in a forest"
- "Sci-fi laser gun firing with echo"
- "Medieval sword clashing against shield"
- "Mystical wind chimes in ancient temple"
API Integration
ElevenLabs Sound Generation API
- Endpoint:
POST https://api.elevenlabs.io/v1/sound-generation - Parameters:
text(required): Sound descriptionduration_seconds(optional): 0.5-22 secondsprompt_influence(optional): 0-1 creativity control
- Output: MP3 audio file
File Structure
sound-effects/
├── index.php # Main application
├── config.php # API configuration
├── .htaccess # Security & MIME types
├── generated/ # Generated sound files (auto-created)
└── README.md # This file
Security Features
- Config Protection:
.htaccessprevents direct access toconfig.php - File Cleanup: Automatic deletion of old generated files
- Input Validation: Sanitized user inputs and API parameters
- Session Security: Secure token management with Azure AD
- HTTPS Redirect: Enforced secure connections
Browser Support
- Chrome/Edge: Full support
- Firefox: Full support
- Safari: Full support (including iOS)
- Mobile: Responsive design for all mobile browsers
Troubleshooting
Common Issues
"Please configure your ElevenLabs API key"
- Edit
config.phpand add your actual API key
Authentication Issues
- Check Azure AD configuration
- Verify redirect URI matches your domain
- Clear browser cache and try again
Sound Generation Fails
- Verify API key is valid and has credits
- Check internet connection
- Try simpler text descriptions
File Permission Errors
- Ensure
generated/directory exists and is writable - Check web server file permissions
Debug Mode
Add error reporting to troubleshoot issues:
// Add to top of index.php for debugging
error_reporting(E_ALL);
ini_set('display_errors', 1);
Development
Adding Features
- Edit
index.phpfor UI/functionality changes - Modify
config.phpfor new settings - Update
.htaccessfor security rules
Customization
- Colors: Modify CSS variables in the
:rootsection - Fonts: Change Google Fonts import and CSS font-family
- Authentication: Update Azure AD configuration as needed
License
This project is for internal use with Oliver Agency's infrastructure and authentication systems.
Support
For technical issues or questions:
- Email: optical@oliver.agency
- Check ElevenLabs API documentation for sound generation issues
- Verify Azure AD configuration for authentication problems