Start
//

How To: Choose Between trimstart and sourcein

Problem: You need to trim an audio clip but aren't sure which approach to use.

Solution: Choose based on how you're thinking about the trim.

Use trimstart/trimend when:

  • You're thinking "remove X seconds from the start/end"
  • You're adjusting an existing clip (e.g., "make this 10-second clip 6 seconds")
  • You're building UI with sliders that adjust trim length
  • Example: "Trim 2 seconds from each end of this clip"

Use sourcein/sourceout when:

  • You know the exact timestamps you want (e.g., from an audio editor)
  • You're referencing specific moments by timecode
  • You need frame-perfect accuracy with known time positions
  • Example: "Show audio from 2:30 to 3:15 of the source file"

Both approaches produce the same audio result, but they differ in how they affect time tracking. For technical details on how each affects currentSourceTimeMs, see Trimming Semantics in the concepts doc.