ExtractSounding150

## Extract 150 ms before first and after last sounding part

# get selected sound, analyse silence/sounding structure
s1 = selected("Sound")
tg1=To TextGrid (silences): 100, 0, -25, 0.1, 0.1, "silent", "sounding"
niv=Get number of intervals: 1

# assume interval 1 and niv are silent
sil1=Get end point: 1, 1
sil2=Get starting point: 1, niv

# move boundaries
sil1=sil1-0.150
sil2=sil2+0.150

# extract, assumes there are 150ms to the left and right of sounding
select 's1'
s2=Extract part: sil1, sil2, "rectangular", 1, "no"
select 'tg1'
Remove
select 's2'