form 降噪脚本
	comment 原始声音文件所在的文件夹地址
	text input_Directory C:\Users\ran\Desktop\test\周殿福国际音标\元音\wav
	comment	经过降噪的声音文件的保存地址
	text output_Directory	C:\Users\ran\Desktop\test\周殿福国际音标\元音\wav\denoised
endform

if left$(input_Directory$,1)<>"\"
	input_Directory$=input_Directory$+"\"
endif

if left$(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$'
	Remove noise... 0 0 0.025 80 10000 40 Spectral subtraction
	Write to WAV file... 'output_Directory$''simpName$'.wav
	Remove
	select Sound 'simpName$'
	Remove
endfor
select all
Remove

exit OK！所有声音文件已经降噪并另存！
