########################################################## # increase-duration-by-percent.praat ( Written by Kyuchul Yoon kyoon@ling.osu.edu ) # This script lets a user select an interval and increases the duration of the interval # by the amount (in % or in msec) specified in the form ########################################################## form Specify files and folders word inFile_(with_wav) 1.wav comment Number of repetitions you want natural numOfRepetition 5 comment Percent increase wrt/ original duration real percentOrigDur_(wrt_original_duration) 200 comment A subfolder with the input filename will be created automatically endform folderName$ = inFile$ - ".wav" 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 for i to numOfRepetition select Sound targetSection To Manipulation... 0.01 75 600 Rename... manip factorOfAddition = percentOrigDur/100 * i paramOfIncrease = factorOfAddition + 1 Create DurationTier... targetDur 0 lenTargetSel Add point... 0 paramOfIncrease Add point... lenTargetSel paramOfIncrease select Manipulation manip plus DurationTier targetDur Replace duration tier select Manipulation manip Get resynthesis (PSOLA) 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... 'i' Play pause Write and proceed to next? Write to WAV file... 'folderName$'/'folderName$'-'i'.wav select Manipulation manip # plus DurationTier targetDur plus Sound lengthenedTargetSection plus Sound newBeginSection plus Sound newTargetSection plus Sound newEndSection Remove endfor