У меня есть несколько речевых файлов, и мне нужно вырезать определенную часть звукового файла, от 0,21 миллисекунды до 0,45 миллисекунды. Сценарий ниже выберет звуковой сегмент от 0,21 миллисекунды до 0,45 миллисекунды и сохранит его. Я хочу вырезать сегмент из файла речи, а затем сохранить его без него. Вероятно, мне следует добавить еще одну строку после «Переместить конец выделения к ближайшему пересечению нуля» и изменить «Записать выбранный звук ...», но я не уверен, как именно.
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