2016-08-04 37 views
0

我嘗試將praat聲音對象保存到wav文件。當我在GUI中執行時沒有問題。但它在腳本中抱怨「聲音未連接並且未保存」。有誰知道爲什麼?如何在praat中用腳本保存WAV文件?

這裏是命令行輸出:

~/Downloads$ /Applications/Praat.app/Contents/MacOS/Praat --run aa1.praat 
Error: Cannot create file 「/Users/hgneng/Downloads/"/Users/hgneng/Downloads/aa2.wav"」. 
Sounds not concatenated and not saved to 「/Users/hgneng/Downloads/"/Users/hgneng/Downloads/aa2.wav"」. 
Script line 15 not performed or completed: 
« Save as WAV file... "/Users/hgneng/Downloads/aa2.wav" » 
Script 「/Users/hgneng/Downloads/aa1.praat」 not completed. 
Praat: script command <<aa1.praat>> not completed. 

這裏是普瑞特腳本的內容:

sound = Read from file: "/Users/hgneng/e-guidedog/jyutping-wong/aa1.wav" 
endtime = Get end time 
To Manipulation... 0.01 75 600 
selectObject: sound 
Create DurationTier: "aa1", 0, endtime 
Add point: 0, 3 
selectObject: "Manipulation aa1" 
plusObject: "DurationTier aa1" 
Replace duration tier 
minusObject: "DurationTier aa1" 
Get resynthesis (overlap-add) 
removeObject: sound 
removeObject: "Manipulation aa1" 
removeObject: "DurationTier aa1" 
Save as WAV file... "/Users/hgneng/Downloads/aa2.wav" 

回答

0

變化

Save as WAV file... "/Users/hgneng/Downloads/aa2.wav" 

Save as WAV file: "/Users/hgneng/Downloads/aa2.wav" 

將解決此問題。

+1

所謂的_shorthand_語法也適用,但在這種情況下,您不需要引號。所以'保存爲WAV文件... /用戶/ hgneng /下載/ aa2.wav'也可以工作。它不工作的原因是因爲_shorthand_命令或過程的最後一個參數是未加引號的字符串。因此,在您的原始行中,引號是文件名的一部分。 – jja

相關問題