Home
24. June 2014 Praat Scripting Summary Praat: Controlling the User
Contents
1. i Save as WAV file directoryName sound string i wav endfor endif A window will appear and the user will be able to choose a directory If the user clicks OK the variable directoryName will contain the name of the directory that the user selected if the user clicks Cancel the variable directoryName will contain the empty string 2 Exercise Write a script that reads in all sound files of a directory creates a TextGrid for each WAV file pauses the script so the user can segment and annotate within the TextGrid a a oO Nee ae a ee continues when the user finished annotating saves the TextGrid and checks whether a TextGrid with the same name already exists see fileReadable if it does pause the script to rename the object
2. 24 June 2014 Praat Scripting Summary Praat Controlling the User Pauses 1 Controlling the user You can temporarily halt a Praat script pause text suspends execution of the script and allows the user to interrupt it a message window will appear with the text and the buttons Stop and Continue pause The next file will be beerbeet TextGrid Pause stop or continue The next file will be beerbeet TextGrid You can also include the same kinds of arguments as for a form But to do so you have to use a different syntax for i to 5 Read from file sound string i wav Play Remove beginPause Rate the quality comment How good is the sound on a scale from 1 to 77 choice Quality 4 option 1 option 2 option 3 option 4 option 5 option 6 option 7 endPause if i 5 then Finish else Next fi 1 appendinfoLine quality endfor Pause Rate the quality How good is the sound ona scale from 1 to 7 Quality 1 Revert Stop rows 5 15 use the new syntax as already known from our other scripts this is different to the syntax of the forms Reference Praat User Manual Scripting 6 6 Controlling the user 13 06 2014 24 June 2014 Praat Scripting row 15 if i equals 5 the button to proceed will change from Next to Finish the end of the argument fi equals the endif command used within a script 1 defines the button that is highlighted File selection If you want the use
3. r to choose a file name for reading opening use the following fileName chooseReadFile Open a table file if fileName lt gt table Read Table from tab separated file fileName endif A window will appear and the user will be able to choose a here table file If the user clicks OK the variable fileName will contain the name of the file that the user selected If the user clicks Cancel the variable will contain an empty string Do the following if you want the user to choose a file name for writing saving selectObject Sound example fileName chooseWriteFile Save as a WAV file example wav if fileName lt gt Save as WAV file fileName endif A window will appear and the user will be able to choose an appropriate file name in this example a file name has been suggested example wav If the user clicks OK the form will ask for confir mation if the file name that the user typed already exists If the user clicks OK with a new file name or clicks OK in the confirmation window the variable fileName will contain the file name that the user typed if the user clicks Cancel at any point the variable fileName will contain the empty string If you want the user to choose a directory folder name do the following directoryName chooseDirectory Choose a directory to save all the new files in if directoryName lt gt for i to number0fSelectedSounds selectObject sound
Download Pdf Manuals
Related Search
Related Contents
料金表:ビデオカメラレンタル PDF 6023KB - タカショーCAD・取扱説明書データ ダウンロード 二重絶縁 User Manual - Elan Medical Supplies Copyright © All rights reserved.
Failed to retrieve file