Trimming Semantics: Two Approaches
Editframe supports two different mental models for trimming audio, each serving different use cases. This dual approach solves a fundamental problem: different workflows need different ways of thinking about time.
Why Two Approaches?
Using a single trimming model creates friction across different workflows:
- UI builders need relative trimming (drag handles inward from edges)
- Professional workflows need absolute timecode (precise frame references)
- Data tracking needs trimming that doesn't break source-time alignment
By supporting both models, Editframe enables the right mental model for each workflow without forcing compromises.
Relative Trimming: trimstart / trimend
Mental model: "Remove X seconds from the start/end of the clip"
This matches the interface of consumer audio editors where you drag handles inward from the edges.
<!-- 10s source → 6s clip (remove 2s from each end) --><ef-audio src="audio.mp3" trimstart="2s" trimend="2s"></ef-audio>
How it works:
trimstart: Offset from the beginning of the sourcetrimend: Offset from the end of the source- Duration:
sourceDuration - trimstart - trimend - Effect on
currentSourceTimeMs:trimstart + ownCurrentTimeMs
Absolute Trimming: sourcein / sourceout
Mental model: "Show audio from timestamp A to timestamp B"
This matches professional audio editors that use absolute source timecode.
<!-- Show exactly 2s to 4s from source (2s clip) --><ef-audio src="audio.mp3" sourcein="2s" sourceout="4s"></ef-audio>
How it works:
sourcein: Absolute start time in source audiosourceout: Absolute end time in source audio- Duration:
sourceout - sourcein - Effect on
currentSourceTimeMs:sourcein + ownCurrentTimeMs
When to Use Each
trimstart/trimend | sourcein/sourceout | |
|---|---|---|
| Mental model | "Cut off X seconds" | "Show timestamp A to B" |
| Best for | UI sliders, drag handles | Timecode from audio editors |
| Duration thinking | Relative (how much to remove) | Absolute (which window to show) |
| Source-time tracking | trimstart + ownCurrentTimeMs | sourcein + ownCurrentTimeMs |