How to Run Praat from Visual C++
Following are the steps for using Praat with
Visual C++:
- Download
Praat from http://www.fon.hum.uva.nl/praat/praat4216_winsit.exe
- Download
SendPraat from http://www.fon.hum.uva.nl/praat/sendpraat.exe
- Extract
both Praat and Sendpraat in to location e.g. D:\praat
It should look some
thing like this:
D:\praat\praat.exe
D:\praat\sendpraat.exe
- Now
Right click My Computer icon and
click Properties or Press
Windows+Break Button together. A “System
Properties” Dialog will appear. Select Tab “Advanced”. At the bottom there is button “Environment Variables”, click it. A window appears with two
frames. In the “System variables”
frame double click the Variable namely “Path”. In the “Variable
value” textbox append “;D:\praat\”
(don’t forget to use ; to separate from previous path).
- Restart
your computer
- After
doing this open “Command Prompt”
by typing “cmd” in Start->Run. On the console Type “praat.exe” and
praat should open, similarly type sendpraat.exe and sendpraat message
should appears. This shows that praat had been added successfully to the
path variable and it can be executed by just typing praat at the Command
Prompt.
- Type
the following code in Visual C++ , can be typed under the button press:
WinExec("praat.exe",SW_SHOWMINNOACTIVE);
CString command = "";
command =
"sendpraat praat \"Open long sound file... c:\\Windows\\Media\\ding.wav\"";
WinExec( command, SW_SHOW
);//SW_HIDE,SW_SHOWMINNOACTIVE
- If
the script is unable to Run you can see Message.txt. Type “praat” in
Start->Run and open Message.txt file to view the script which has been
sent to praat. Remember that the script is Case Sensitive. You can also
write this script inside praat to check it. For this open Praat. From “Control”
menu, click “New Praat script”. Type the script and Press Run to see
whether the script you are trying to send is valid or not.
Comments