Previous Up Next

28.2.10  Trimming silence

You can find leading and/or trailing silence and remove it by using the trim command (see Section 5.2.5, Section 21.2.2 and Section 28.1.9 for other usages of trim).

Example

With the file gs-16b-2c-44100hz.wav downloaded from here (an excerpt from a piece of band music):

clip1:=readwav("/home/luka/Downloads/gs-16b-2c-44100hz.wav")
     
a sound clip with 698194 samples at 44100 Hz (16 bit, stereo)           
plotwav(clip1)
clip2:=trim(clip1)
     
a sound clip with 538796 samples at 44100 Hz (16 bit, stereo)           
plotwav(clip2)

Previous Up Next