A web application for creating seamless loops from ambient audio files with intelligent loop optimization.
- Audio Upload: Support for WAV, MP3, OGG, and other common audio formats
- Waveform Visualization: Interactive waveform display with draggable loop markers
- Smart Loop Optimization: Automatically adjusts loop points using:
- Zero-crossing detection (eliminates clicks/pops)
- Volume matching (RMS analysis)
- Phase correlation (smooth transitions)
- Crossfade application
- Preview Playback: Listen to your loop in real-time before exporting
- Dual Export Modes:
- Single Loopable Segment: Export just the optimized loop segment
- Extended Loop: Generate a longer file by repeating the loop (1-60 minutes)
npm installnpm run devOpen your browser to the URL shown in the terminal (usually http://localhost:5173)
npm run buildThe built files will be in the dist directory.
- Upload an ambient audio file (drag & drop or click to browse)
- Adjust the blue loop markers on the waveform to roughly select your desired loop region
- Configure the crossfade duration (50-500ms recommended)
- Click "Optimize Loop Points" to let the algorithm find the best loop boundaries
- Preview your loop using the play button to ensure it sounds seamless
- Choose export mode:
- Single Loopable Segment: For importing into DAWs or game engines
- Extended Loop: For creating longer ambient soundscapes
- Download your optimized loop!
The app uses a multi-step optimization process:
- Zero-Crossing Detection: Finds points where the audio waveform crosses zero amplitude, preventing clicks
- Volume Matching: Analyzes RMS levels to ensure similar volumes at loop start/end
- Phase Correlation: Uses cross-correlation to find phase-aligned points for smooth transitions
- Crossfade: Applies equal-power crossfade at loop boundaries
- Format: WAV (16-bit PCM)
- Sample Rate: Preserved from original file
- Channels: Preserved from original file
Works best in modern browsers with Web Audio API support:
- Chrome 90+
- Firefox 88+
- Safari 14+
- Edge 90+
audio-looper/
├── src/
│ ├── components/ # React components
│ ├── utils/ # Audio processing utilities
│ ├── types/ # TypeScript type definitions
│ ├── App.tsx # Main application component
│ └── main.tsx # Application entry point
├── plan.md # Detailed project plan
└── README.md # This file
ISC
This is a personal project, but suggestions and improvements are welcome!