怎么在praat里调节基频和时长

发布网友 发布时间:2022-04-22 04:43

我来回答

2个回答

热心网友 时间:2023-09-18 20:00

Praat脚本具有强大的功能,对语音文件标注完成后,下面的任务就是把成百上千的语音文件中的参数提取出来,最基本的就是时长,和基频,其它还有元音可能要提取共振峰,如果对这些文件全部手工提取,工作量可想而知,而使用Praat脚本即可以批量提取,便于统一整理。这里先介绍如何提取时长和基频的脚本,随后以如何绘制汉字声调图为例,说明一个小的应用。

1. 基本的读文件以及文件名操作(略)
2. 基频处理
 

热心网友 时间:2023-09-18 20:00

该脚本全文: form 框 positive the_Index_of_Referenced_Tier_in_TextGrid 1 positive the_Number_of_Pitch_Points_in_a_Interval 10 endform dirPath$="C:\temp\" Create Strings as file list... list'dirPath$'\*.TextGrid fileNum=Get number of strings tierNum=the_Index_of_Referenced_Tier_in_TextGrid pointNum=the_Number_of_Pitch_Points_in_a_Interval for ifile to fileNum select Strings list fileName$=Get sting... ifile newFileName$=fileName$-".TextGrid" textGridFileName$=newFileName$+".TextGrid" textGridFileName$=dirPath$+textGridFileName$ pitchTierFileName$=newFileName$+".PitchTier" pitchTierFileName$=dirPath$+pitchTierFileName$ saveFileName$=newFileName$+"_Pitch.txt" saveFileName$=dirPath$+saveFileName$ filedelete'saveFileName$' fileappend'saveFileName$'文件名 fileappend'saveFileName$', fileappend'saveFileName$'标注内容 fileappend'saveFileName$', fileappend'saveFileName$'起点间 fileappend'saveFileName$', fileappend'saveFileName$'末点间 fileappend'saveFileName$', fileappend'saveFileName$' fileappend'saveFileName$', Read from file... 'pitchTierFileName$' select PitchTier'newFileName$' pitchPointNum=Get number of points for pitchNum from 1 to pitchPointNum pitchTime'pitchNum'=Get time from index... 'pitchNum' endfor pitchNum=pitchPointNum+1 pitchTime'pitchNum'=Get finishing time Read from file... 'textGridFileName$' select TextGrid'newFileName$' dd=Is interval tier... 'tierNum' if dd=1 intervalNum=Get number of intervals... 'tierNum' endif if dd=0 intervalNum=Get number of points... 'tierNum' endif begin Time0=0 endTime0=0 for interNum from 1 to intervalNum if dd=1 labeName'interNum'$=Get label of interval... 'tierNum''interNum' beginTime'interNum'=Get starting point... 'tierNum''interNum' endTime'interNum'=Get end point... 'tierNum''interNum' selLength'interNum'=endTime'interNum'-beginTime'interNum' endif if dd=0 labeName'interNum'$=Get label of point... 'tierNum''interNum' xuhao='interNum'-1 beginTime'interNum'=endTime'xuhao' endTime'interNum'=Get time point... 'tierNum''interNum' selLength'interNum'=endTime'interNum'-beginTime'interNum' endif startPoint=1 pitchStartTime=0 pitchEndTime=0 startSel=0 sT=beginTime'interNum' eT=endTime'interNum' pitchStartTime'interNum'=0 pitchEndtTime'interNum'=0 for pitchNum from startPoint to pitchPointNum if pitchTime'pitchNum'>sT and pitchTime'pitchNum'eT pitchEndtTime'interNum'=pitchTime'pitchNum' endif startPoint=pitchNum-1 endif endfor endfor select PitchTier'newFileName$' dianNum=pointNum for interNum from 1 to intervalNum if interNum=1 fileappend'saveFileName$'基频起点 fileappend'saveFileName$', fileappend'saveFileName$'基频末点 fileappend'saveFileName$', for dian from 1 to dianNum fileappend'saveFileName$' 点 fileappend'saveFileName$''dian' fileappend'saveFileName$'-基频值 fileappend'saveFileName$', endfor fileappend'saveFileName$''newline$' endif fileappend'saveFileName$''textGridFileName$' fileappend'saveFileName$', IN$=labeName'interNum$' fileappend'saveFileName$''IN$' fileappend'saveFileName$', bT=beginTime'interNum' fileappend'saveFileName$''bT' fileappend'saveFileName$', eT=endTime'interNum' fileappend'saveFileName$''eT' fileappend'saveFileName$', sL=selLength'interNum' fileappend'saveFileName$''sL' fileappend'saveFileName$', pST=pitchStartTime'interNum' pET=pitchEndTime'interNum' if pST>0 and pET>0 fileappend'saveFileName$''pST' fileappend'saveFileName$', fileappend'saveFileName$''pET' fileappend'saveFileName$', a=pST b=pET c=('b'-'a')/('dianNum'-1) select PitchTier'newFileName$' tempposition='tempposition'+'c' endfor endif fileappend'saveFileName$''newline$' endfor endif select TextGrid'newFileName$' Remove select PitchTier'newFileName$' Remove endfor select Strings list Remove Exi

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com