Looper is a desktop application for detecting, previewing, and exporting music loops from MP3 files.
It analyzes the frequency characteristics of an audio track, searches for sections with similar frequency patterns, and identifies a potential loop point. The detected loop can then be previewed and exported as a new MP3 file.
- Analyze a selected MP3 file to automatically detect a loop
- View the detected loop start and end points
- See the loop duration
- See the detected match percentage
- Preview the detected loop
- Export the detected loop as an MP3 file
- Track analysis progress
Looper detects suitable loop points in MP3 files by combining spectral analysis with waveform-level refinement.
- The MP3 file is decoded into PCM audio using mpg123.
- Stereo audio is converted to mono for analysis.
- The audio is divided into overlapping windows and analyzed using Fast Fourier Transform (FFT).
- Spectral and RMS features are extracted from each window.
- Looper searches for sections with similar spectral patterns over time.
- The strongest candidates are refined by comparing the transitions between the end and beginning of the loop.
- The candidate points are further refined at the sample level using the original waveform.
- Candidates are scored based on spectral similarity and transition quality.
- The detected loop can be previewed directly in the application and exported as a separate MP3 file using FFmpeg.
- Python
- Tkinter
- NumPy
- mpg123
- pygame
- FFmpeg
- Python 3.12
- Windows
- FFmpeg
Python dependencies are listed in requirements.txt.
Clone the repository:
git clone https://github.com/itstxti/Looper.git
cd LooperCreate a virtual environment:
py -3.12 -m venv .venvActivate it:
.\.venv\Scripts\activateInstall the Python dependencies:
python -m pip install -r requirements.txtFFmpeg must also be installed separately and available on the system.
You can verify the installation with:
ffmpeg -versionIf you don't have it installed, the easiest option on Windows is using WinGet:
winget install Gyan.FFmpegRun the application with:
python interface.pyThen:
- Click Choose MP3.
- Select an MP3 file.
- Click Analyze track.
- Wait for the analysis to complete.
- Review the detected loop information.
- Click Play loop to preview it.
- Click Export MP3 to save the MP3 loop.
Looper currently supports MP3 files.
Loop detection is based on frequency-domain analysis and correlation, so the detected point is an automatically estimated loop rather than a guarantee of musical perfection for every track.
Analysis time depends on the length and complexity of the audio file.
Looper is licensed under the MIT License.
Looper also includes mpg123, which is licensed under the GNU Lesser General Public License (LGPL) version 2.1.