How to Run Praat from Visual C++


Following are the steps for using Praat with Visual C++:

  1. Download Praat from http://www.fon.hum.uva.nl/praat/praat4216_winsit.exe

  1. Download SendPraat from http://www.fon.hum.uva.nl/praat/sendpraat.exe

  1. 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

  1. 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).

  1. Restart your computer

  1. 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.

  1. 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

  1. 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.

In the same manner you can run multiple script commands as well by using commands like above multiple times.

Comments

Popular posts from this blog

Imote2 with Camera setup IMB400 over Ubuntu 9.10/10.04

Branch and bound algorithm in C#- Article by AsiF Munir

Tensorflow - Simplest Gradient Descent using GradientDescentOptimizer