praat - delete segment
<p>I have several speech files and I need to cut a certain part of the sound file, from 0.21 milliseconds to 0.45 milliseconds. The script below will select the sound segment from 0.21 milliseconds to 0.45 milliseconds and save it. I want to cut the segment from the speech file and then save it without it. I should probably add another line after "Move end of selection to nearest zero crossing" and change the "Write selected sound..." but I am not sure how exactly.</p>

<pre><code>form Files
    sentence InputDir  ./
endform

createDirectory ("output")
Create Strings as file list... list 'inputDir$'*.wav
numberOfFiles = Get number of strings

for ifile to numberOfFiles

    select Strings list
    fileName$ = Get string... ifile
    Read from file... 'inputDir$''fileName$'
    sound_name$ = selected$ ("Sound")

        select Sound 'sound_name$'
        Edit
        editor Sound 'sound_name$'
        Select... 0.21 0.45
        Move start of selection to nearest zero crossing
        Move end of selection to nearest zero crossing
        Write selected sound to WAV file... ./output/'fileName$'
        endeditor

    select all
    minus Strings list
    Remove

endfor

select all
Remove 
</code></pre>