Search code examples
praat

How to save WAV file with script in praat?


I try to save a praat sound object to wav file. There is no problem when I do it in GUI. But it complains "Sounds not concatenated and not saved" in script. Does anyone know why?

Here is the command line output:

~/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.

Here is the content of praat script:

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"

Solution

  • Change

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

    to

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

    will fix the issue.