Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)

AudioTrim

AudioTrim[audio]
trims silence from the beginning and end of audio.

AudioTrim[audio,t]
returns the first t seconds of audio.

AudioTrim[audio,-t]
returns the last t seconds of audio.

AudioTrim[audio,{t1,t2}]
returns audio starting at time t1 and ending at time t2 of audio.

AudioTrim[audio,{{t11,t12},}]
returns a list of audio for all given intervals {ti1,ti2}.

Details and OptionsDetails and Options

  • AudioTrim can be used to either extract interesting parts of some audio or remove uninteresting parts, e.g. silence.
  • AudioTrim[audio] finds and removes silence intervals at the beginning and end of audio as silence where all samples have amplitudes below .
  • 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 with the following settings:
  • Noneno padding (default)
    0silence padding
    "Periodic"cyclic repetitions of the complete image
    "Reflected"reflections of the image in the boundary
    "Reversed"reversals of the complete image
  • In AudioTrim[audio,t], when t is longer than the duration of audio, by default no extra padding is introduced.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Import sound as an audio object:

In[1]:=
Click for copyable input

Trim the silence at the beginning and end:

In[2]:=
Click for copyable input
Out[2]=

Take the first 2 seconds:

In[3]:=
Click for copyable input
Out[3]=

Take the last 2 seconds:

In[4]:=
Click for copyable input
Out[4]=

Take from time 1.5 to 2.5:

In[5]:=
Click for copyable input
Out[5]=
Introduced in 2016
(11.0)