#功能:对WAV格式的声音文件进行批量降噪(只适用于Windows操作系统) #作者:张明辉(华睿宝科技有限公司),使用此脚本进行学术研究或撰写论文,请在脚注中予以说明或在参考文献中进行援引,多谢支持! #时间:2020年2月18日 #关于降噪参数的设置:可以点击Praat Help,搜寻“Remove noise”,点击“Sound: Remove noise...”查看相关参数的含义(主要包括降噪时间段、窗宽、频段等),由此来自主设定降噪参数 form 设置声音文件打开及保存路径名、和各类降噪参数 sentence Open_File_Path sentence Save_File_Path positive lowFrequency 80 positive highFrequency 10000 positive smoothingBandwidth 40 real noiseReduction -20 endform openPath$ = open_File_Path$ savePath$ = save_File_Path$ if right$(openPath$,1)<>"\" openPath$ = openPath$+"\" endif if right$(savePath$,1)<>"\" savePath$ = savePath$+"\" endif Create Strings as file list: "fileList", "'openPath$'*.wav" numberOfFiles = Get number of strings i = 1 while i <= numberOfFiles selectObject: "Strings fileList" filename$ = Get string: i openName$ = openPath$ + filename$ Read from file: openName$ name$ = selected$("Sound") Reduce noise: 0, 0, 0.025, lowFrequency, highFrequency, smoothingBandwidth, noiseReduction, "spectral-subtraction" name1$ = selected$("Sound") selectObject: "Sound 'name$'" Remove selectObject: "Sound 'name1$'" Rename: name$ selectObject: "Sound 'name$'" Save as WAV file: "'savePath$''name$'.wav" Remove i = i + 1 endwhile selectObject: "Strings fileList" Remove echo 所有声音文件均已降噪并保存!