#批量改变声音的性别特征(需要同文件夹内为同一性别的声音) #7月8日 南开大学韩璐璐 2120201469 form 批量改变声音的性别特征 comment 原始声音文件所在的文件夹地址 text input_Directory D:\学习\研一\Praat脚本和语音计算\praat脚本编写与应用\作业 comment 经过处理的声音文件的保存地址 text output_Directory D:\学习\研一\Praat脚本和语音计算\praat脚本编写与应用\作业\new choice informant_character button 男 button 女 endform if right$(input_Directory$,1)<>"\" input_Directory$=input_Directory$+"\" endif if right$(output_Directory$,1)<>"\" output_Directory$=output_Directory$+"\" endif createDirectory: output_Directory$ Create Strings as file list... fileList 'input_Directory$'*.wav numberOfFiles = Get number of strings for ifile from 1 to numberOfFiles select Strings fileList fileName$ = Get string... 'ifile' simpName$ = fileName$ - ".wav" Read from file... 'input_Directory$''fileName$' if informant_character$="男" Change gender: 75, 600, 1.3, 0, 1, 1 selectObject: "Sound 'simpName$'_changeGender" To Manipulation: 0.01, 75, 600 Extract pitch tier Shift frequencies: 0, 1000, 60, "Hertz" Multiply frequencies: 0, 1000, 1.5 else Change gender: 75, 600, 0.9, 0, 1, 1 selectObject: "Sound 'simpName$'_changeGender" To Manipulation: 0.01, 75, 600 Extract pitch tier Shift frequencies: 0, 1000, -30, "Hertz" Multiply frequencies: 0, 1000, 0.6 endif selectObject: "Manipulation 'simpName$'_changeGender" plusObject: "PitchTier 'simpName$'_changeGender" Replace pitch tier selectObject: "Manipulation 'simpName$'_changeGender" Get resynthesis (overlap-add) Save as WAV file: "'output_Directory$''simpName$'.wav" endfor select all Remove