-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathintensity-scaling
43 lines (31 loc) · 1.07 KB
/
intensity-scaling
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
############################
#
# Scales the intensity of all the files
# in a specified directory to be equal.
#
############################
form Scale intensity
comment Directory of sound files
text sound_directory D:\UoA\04research\01PB_verbal\00CreateTextgrids\CV-20210810\
sentence Sound_file_extension .wav
comment Directory for resulting files
text end_directory D:\UoA\04research\01PB_verbal\00CreateTextgrids\CV-20210810\
comment Scale to what intensity
positive intensity 60.0
endform
# you make a listing of all the sound files in a directory.
Create Strings as file list... list 'sound_directory$'*'sound_file_extension$'
numberOfFiles = Get number of strings
for ifile to numberOfFiles
# A sound file is opened from the listing:
filename$ = Get string... ifile
Read from file... 'sound_directory$''filename$'
# Scale intensity
Scale intensity... intensity
# Save resulting file
newname$= filename$ - ".wav" + "_int.wav"
Write to WAV file... 'end_directory$''newname$'
select Strings list
endfor
select all
Remove