I built Ringtone Cropper, a free, open-source browser tool for turning a short section of audio into a ringtone for Android or iPhone.
Try the editor · Source on GitHub
Here's the workflow in about 30 seconds:
What it does
Upload an audio or video file, select a moment on the waveform, preview it, and export. The selection defaults to exactly 30 seconds, with 15/30/40-second presets and custom lengths.
There are fade-in and fade-out controls, looped preview, optional loudness normalization, and MP3, M4A, M4R, or WAV exports. The interface works on mobile and desktop, with light, dark, and system themes. No signup is needed.
The site creates the audio file; your phone's apps or settings apply it as a ringtone. It includes setup instructions, including a GarageBand workflow for iPhone.
What runs where
The frontend is plain HTML, CSS, and JavaScript. Web Audio handles decoding and preview, while ffmpeg.wasm handles export in the browser.
For an uploaded file, the flow is:
Local file → browser decoding + waveform
→ selection + preview
→ browser export → download
Local files stay on your device.
Optional YouTube imports take a different path: a Cloudflare Worker validates and rate-limits the request, then a container running yt-dlp retrieves the audio. Trimming and export still happen in the browser. These imports are for audio you're permitted to download.
A small detail: keeping 30 seconds exactly 30 seconds
Selection boundaries use a 0.1-second grid. A subtle edge case is a source that ends between grid points: rounding after clamping can push a selection past the actual end.
The selection helper floors the available duration to that grid first, fits the clip length, and then clamps its start. The same helper keeps the presets and editable boundaries consistent.
Audio quality has a ceiling
YouTube imports request the best available audio stream without an intermediate lossy conversion. Exports use the original source, with 320 kb/s MP3 or AAC options and uncompressed WAV.
A higher export bitrate can't recover detail missing from the source. WAV avoids another lossy encode, but doesn't magically improve the recording.
I'd love feedback on the waveform controls and export experience—especially on a phone. Is it easy to select the exact moment you want?
Top comments (5)
apoorv, this is a fantastic execution of a local-first, privacy-respecting tool! 🐯
using ffmpeg.wasm to keep the entire export pipeline in the browser is a massive win. it completely eliminates server compute costs and respects user privacy, which perfectly mirrors the constraint-driven philosophy i enforce when building koda.
your detail about flooring the available duration to the 0.1s grid before clamping to prevent edge-case overflow is a senior-level engineering catch. most devs would just let it round up and wonder why the export fails or truncates weirdly on specific files.
regarding your question about mobile waveform controls: on budget phones, touch targets and visual clarity are everything. one small suggestion would be adding a bold, high-contrast visual "snap" line or marker when the selection hits exactly the 30s mark, making it foolproof to adjust on smaller, lower-resolution screens.
fantastic, highly practical open-source work! checking out the github now. 🛠️📱
thanks ;D
apoorv, anytime! keep building awesome local-first tools. the web needs more of this. 🛠️
Some comments may only be visible to logged-in visitors. Sign in to view all comments. Some comments have been hidden by the post's author - find out more