########################################################## # fix-preceding-V-duration.praat ( Written by Kyuchul Yoon kyoon@ling.osu.edu ) # This script lets a user select an interval and sets the duration of the V interval # to a certain value (in msec) specified in the form ########################################################## form Specify files and folders word inFile_(with_wav) basson.wav comment vowel duration to fix real vowelDur_(in_milliseconds) 100 comment A subfolder with the input filename will be created automatically endform folderName$ = inFile$ - ".wav" folderName$ = folderName$ + "-dur.fixed.to.msec-" suffix$ = fixed$(vowelDur,0) folderName$ = folderName$ + suffix$ system mkdir 'folderName$' Read from file... 'inFile$' Rename... inFile finishTime = Get finishing time select Sound inFile Edit editor Sound inFile pause Select the interval whose duration you wish to increase Move begin of selection to nearest zero crossing Move end of selection to nearest zero crossing beginSel = Get begin of selection endSel = Get end of selection lenTargetSel = endSel - beginSel Select... 0 beginSel Extract windowed selection... beginSection Rectangular 1 no Select... beginSel endSel Extract windowed selection... targetSection Rectangular 1 no Select... endSel finishTime Extract windowed selection... endSection Rectangular 1 no Close endeditor select Sound inFile Write to WAV file... 'folderName$'/'folderName$'-orig.wav select Sound targetSection To Manipulation... 0.01 75 600 Rename... manip durInSec = vowelDur / 1000 paramOfIncrease = durInSec / lenTargetSel Edit editor Manipulation manip Set duration range... 0 10 Add duration point at... 0 paramOfIncrease Add duration point at... lenTargetSel paramOfIncrease Publish resynthesis Close select Sound fromManipulationEditor Rename... lengthenedTargetSection select Sound beginSection Copy... newBeginSection select Sound lengthenedTargetSection Copy... newTargetSection select Sound endSection Copy... newEndSection select Sound newBeginSection plus Sound newTargetSection plus Sound newEndSection Concatenate Rename... conccatSound Play Edit editor Sound conccatSound pause Write? Close select Sound conccatSound Write to WAV file... 'folderName$'/'folderName$'.to-'vowelDur'ms.wav select Manipulation manip plus Sound lengthenedTargetSection plus Sound newBeginSection plus Sound newTargetSection plus Sound newEndSection plus Sound beginSection plus Sound targetSection plus Sound endSection Remove