I left out explicitly selecting objects since it is not necessarily required, but every command works on "the selected object" and it's easy to lose track of what is selected.Īnother common approach is to beg a colleague to write it for you. I would plan on spending a lot of time trying to understand simple things like string variables, or object selection. If you have that much sorted out, then the basic logic is get next input file name file This implies some computation of the output file name based on the input file name, so you need to get familiar with how string manipulation works in Praat. You will (probably) need a file with wav file names, and some system for naming the output files, for example if you have "input1.wav", you might want to call the cut-down version "output1.wav". For example: script <- system.file('extdata', 'play-greetings.praat', package 'speakr') praatrun(script) If the script has side effects, like creating new files or editing existing ones, these effects will take place. The first argument of the function is the path to the script. Then you need to add a loop that does this a number of times, to different files. To run a Praat script, use the function praatrun (). There is also a command to save a file as a wav file, so you would add that to the core of the script. The manual approach is to look for "Extract part" under "Convert", which corresponds to the command Extract part: 0, 22, "rectangular", 1, "no" In general, the easiest way to at least start a script is to do a thing manually once, and after you've done that, in a Praat script window, copy the command history (with ctrl-h) to see what the underlying commands are. The first step is to construct a script that extracts the initial 22 seconds of some specific sound object that is already open.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |