From 7e87e1c85d8eab5437d6463a1ddb6c98fca767bb Mon Sep 17 00:00:00 2001 From: feelins Date: Thu, 4 Apr 2024 11:32:14 +0800 Subject: [PATCH] update 9th scirpt, ignore blank interval --- .../Get_Duration_and_Pitch.Praat | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/09-get_duration_and_pitch/Get_Duration_and_Pitch.Praat b/09-get_duration_and_pitch/Get_Duration_and_Pitch.Praat index 9e29777..dbcc52f 100644 --- a/09-get_duration_and_pitch/Get_Duration_and_Pitch.Praat +++ b/09-get_duration_and_pitch/Get_Duration_and_Pitch.Praat @@ -73,18 +73,20 @@ for iFile from 1 to numberOfFiles duration = eTime-sTime labelOfInterval$ = Get label of interval: reference_tier, iInterval - output$ = fileName$ + tab$ + labelOfInterval$ + tab$ + fixed$(duration, 3) + tab$ - stepTime = duration / 9 - for i from 1 to 10 - selectObject: "PitchTier " + objectName$ - tmpTime = sTime + stepTime * (i - 1) - pitchValue = Get value at time: tmpTime - output$ = output$ + fixed$(pitchValue, 0) - if i <> 10 - output$ = output$ + tab$ - endif - endfor - appendFileLine: save_result$, output$ + if labelOfInterval$ <> "" + output$ = fileName$ + tab$ + labelOfInterval$ + tab$ + fixed$(duration, 3) + tab$ + stepTime = duration / 9 + for i from 1 to 10 + selectObject: "PitchTier " + objectName$ + tmpTime = sTime + stepTime * (i - 1) + pitchValue = Get value at time: tmpTime + output$ = output$ + fixed$(pitchValue, 0) + if i <> 10 + output$ = output$ + tab$ + endif + endfor + appendFileLine: save_result$, output$ + endif endfor selectObject: "TextGrid " + objectName$