我正在尝试运行由以下提供的 Praat 脚本:http: //phonetics.linguistics.ucla.edu/facilities/acoustic/Segmenter.txt 但是,当我使用正确的目录运行脚本时,设置我的 label$ = 他,层 = 2,扩展名 = .wav。(Penn Phonetics Lab Chinese Aligner 提供了什么)
我收到结束语句说“所有文件都已分段!祝你有美好的一天!” 但我指定的输出文件夹中没有任何内容。
怎么了?
## This script sections a file into individual vowels, vowels having been marked in some tier using some uniform label such as "v".
## Each vowel is saved as an individual Praat Sound file with the name of the original file plus a number indicating which vowel is being saved.
## 25 milliseconds is included to either side of the vowel, to make sure that a formant object includes the entire vowel (25 ms. frames).
## Specify the label you've used to mark your vowels here:
label$ = "他"
## Specify the tier where the vowels are labeled here:
tier_number = 2
## Specify the directory where your sound files and accompanying textgrids are located:
directory$ = "[user pathing]"
## Specify the directory where you want the segmented vowel sound files to be stored:
outdir$ = "[user pathing]"
## Specify what file extension your sound files end in (.wav, .aiff...)
extension$ = ".wav"
clearinfo
Create Strings as file list... list 'directory$'*'extension$'
number_of_files = Get number of strings
for a from 1 to number_of_files
select Strings list
current_sound$ = Get string... 'a'
Read from file... 'directory$''current_sound$'
current_sound$ = selected$("Sound")
Read from file... 'directory$''current_sound$'.TextGrid
number_vowels = Count labels... 1 'label$'
Extract tier... 'tier_number'
current_tier = selected ("IntervalTier")
Get starting points... 'label$'
starting_points = selected ("PointProcess")
select 'current_tier'
Get end points... 'label$'
end_points = selected ("PointProcess")
for i from 1 to number_vowels
select 'starting_points'
start'i' = Get time from index... 'i'
select 'end_points'
end'i' = Get time from index... 'i'
endfor
select Sound 'current_sound$'
Edit
for j from 1 to number_vowels
editor Sound 'current_sound$'
start = start'j'
end = end'j'
Select... 'start' 'end'
Extract selection
endeditor
Write to binary file... 'outdir$''current_sound$'-'j'.Sound
endfor
select all
minus Strings list
Remove
endfor
select all
Remove
print All files have been segmented! Have a nice day!