trims silence from the beginning and end of audio.


returns the first t seconds of audio.


returns the last t seconds of audio.


returns audio starting at time t1 and ending at time t2 of audio.


returns a list of audio for all given intervals {ti1,ti2}.

Details and Options

  • AudioTrim can be used to either extract interesting parts of a recording or remove uninteresting parts, e.g. silence.
  • Intervals with amplitudes below are assumed to be silent.
  • The time t can be any of the following:
  • ttime given in seconds
    Quantity[t,"unit"]time given in "unit" compatible with seconds
    Quantity[t,"Samples"]time given as number of samples
  • AudioTrim takes a Padding option. See the reference page for AudioPad for possible settings.
  • In AudioTrim[audio,t], when t is longer than the duration of audio, by default no extra padding is introduced.


open allclose all

Basic Examples  (1)

Import sound as an audio object:

Trim the silence at the beginning and end:

Take the first 2 seconds:

Take the last 2 seconds:

Take from time 1.5 to 2.5:

Scope  (3)

Specify the amount of trimming using a time Quantity:

Specify the amount of trimming using a number of samples:

Extract multiple intervals:

Applications  (1)

Extract intervals that satisfy a condition:

Use AudioIntervals to look for segments with high RMS amplitude:

Extract the intervals:

Properties & Relations  (1)

Partition an Audio object:

Define the times for partitioning:

Partition the audio object:

Wolfram Research (2016), AudioTrim, Wolfram Language function,


Wolfram Research (2016), AudioTrim, Wolfram Language function,


@misc{reference.wolfram_2020_audiotrim, author="Wolfram Research", title="{AudioTrim}", year="2016", howpublished="\url{}", note=[Accessed: 16-January-2021 ]}


@online{reference.wolfram_2020_audiotrim, organization={Wolfram Research}, title={AudioTrim}, year={2016}, url={}, note=[Accessed: 16-January-2021 ]}


Wolfram Language. 2016. "AudioTrim." Wolfram Language & System Documentation Center. Wolfram Research.


Wolfram Language. (2016). AudioTrim. Wolfram Language & System Documentation Center. Retrieved from