簡體   English   中英

如何從 PRAAT 中的 .wav 文件中自動提取音高范圍並將它們全部放入 .csv 文件中?

[英]How to automatically extract pitch range from .wav files in PRAAT and put them all in a .csv file?

我正在使用 PRAAT,我需要提取音高范圍。 我的音頻文件都不到 2 秒,而且我有十幾個。 我只知道在單擊時獲取信息 現在,我從單擊原始音頻文件上的提取可見音高輪廓后獲得的音高對象手動提取音高范圍(查詢 > 音高信息)。

此腳本會將目錄中所有 .wav 文件的音高范圍記錄到 csv 文件中。 確保在路徑的末尾放置一個斜線。

form Enter Full Path + \
sentence path C:\
endform

filedelete 'path$''name$'pitch_range.csv
header_row$ = "Filename" + tab$ + "Mean F0" + tab$ + "mean SD"  + tab$ + "min pitch" + tab$ + "max pitch" + newline$
header_row$ > 'path$'pitch_range.csv

Create Strings as file list...  list 'path$'*.wav
number_files = Get number of strings
for j from 1 to number_files
   select Strings list
   current_token$ = Get string... 'j'
   Read from file... 'path$''current_token$'
   To Pitch (ac)... 0.01 75 15 no 0.03 0.45 0.01 0.35 0.14 600 
   minpitch = Get minimum... 0 0 Hertz Parabolic
   maxpitch = Get maximum... 0 0 Hertz Parabolic
   range = maxpitch - minpitch
   fileappend "'path$'pitch_range.csv" 'current_token$' 'tab$' 'range:4' 'newline$'
   Remove
endfor

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM