Audio normalizer
Functionality of the Audio Normalizer Application
File Upload
✔ Multiple File Upload: Users can upload multiple audio files (e.g., .mp3, .wav) simultaneously.
✔ Drag-and-Drop Support: Files can be dragged directly into the browser window or selected via an HTML file input.
Audio Analysis
The application analyzes each uploaded file and calculates:
✔ RMS Value (Root Mean Square): Measures the average loudness of the file.
✔ Peak Value: Identifies the highest volume level within the file.
Normalization
✔ Adjust RMS Value: Users can normalize individual files or apply a global RMS value to all uploaded files.
✔ Consistent Audio Levels: The normalizer adjusts audio data to ensure uniform loudness across all files.
Playback of Original & Normalized Versions
✔ Users can preview both the original and normalized versions directly in the browser.
Export & Deletion
✔ Download Normalized Files: Files can be exported as .wav format.
✔ Remove Files: Uploaded files can be deleted from the list when no longer needed.
Visual Progress Indicators
✔ Progress bars show the status of uploading, normalizing, and exporting operations.
Global Control
✔ Apply a single RMS value to all uploaded files for consistent loudness adjustment.
Technical Structure
1. HTML Structure
✔ Layout:
A central container (<div class="container">) holds all UI elements.
Includes elements such as:
<input type="file"> for file selection.
<button> for global actions (export, delete).
<div> elements for progress bars, file lists, and status updates.
✔ Responsive Design:
Uses <meta name="viewport"> to adapt to various screen sizes.
2. CSS Design & User Experience
✔ Modern, Minimalist UI:
Features rounded corners, shadows, and subtle color accents.
Important UI elements (buttons, progress bars) stand out with contrast.
✔ Styling Highlights:
.progress-bar-inner – Animated progress bars with smooth transitions.
.toggle-play-btn – Interactive buttons with hover/focus effects.
.container – Centralized card-style design with shadow effects.
3. JavaScript Logic – Core Functions
3.1 File Upload
✔ Function: handleFiles(event)
Reads uploaded files and validates formats.
Filters out unsupported or non-audio files.
3.2 Audio Analysis
✔ Web Audio API Integration:
Uses OfflineAudioContext for efficient audio processing.
✔ Loudness Analysis:
calculateRMS(buffer) – Computes Root Mean Square loudness.
calculatePeak(buffer) – Detects peak volume levels.
✔ Data Storage:
Stores both original and normalized values for further processing.
3.3 Normalization
✔ Scaling Audio Data:
scaleAudioBufferWithHandling(fileData, targetRms) – Adjusts RMS loudness to the target value.
Uses Gain Nodes in the Web Audio API for precise volume adjustments.
3.4 Playback & Interaction
✔ Audio Playback:
Users can switch between original and normalized versions.
Functions:
playOriginal(fileData) – Plays the original file.
playNormalized(fileData) – Plays the normalized file.
✔ UI Updates:
Progress bars update dynamically (updateProgressBars).
File list is refreshed in real time (addFileToList).
3.5 Exporting & Deleting Files
✔ Export to .wav Format:
Function: bufferToWave(abuffer, offset, len) – Converts an AudioBuffer to a WAV file.
✔ File Removal:
Deletes files from memory and frees resources.
Special Features
✔ Efficient Audio Processing:
Uses Offline Audio Contexts for fast and resource-efficient processing.
✔ User-Friendly Design:
Intuitive UI with visual feedback.
✔ Scalability:
Users can control individual files or apply global settings.
Conclusion
The Audio Normalizer provides a modern, browser-based solution for adjusting audio volume efficiently.
🎵 Key Highlights:
✔ Multi-file upload & batch processing
✔ Real-time RMS & peak analysis
✔ Customizable normalization options
✔ Built-in playback & WAV export
✔ Fast Web Audio API processing
🔹 Perfect for podcasters, musicians, and audio professionals who need a quick and reliable way to normalize audio files directly in the browser! 🚀