Use object IDs and select the objects you want each time (instead of the select all-except-for-these-ones approach you are using).Īvoid using the Editor window for tasks such as these that don't require. Write to WAV file: "./output/" + file$ + ".wav" Part = Extract part: t1, t2, "rectangular", 1, "no" T2 = Get nearest zero-crossing: 1, start + (quart * 3) T1 = Get nearest zero-crossing: 1, start + quart Start = Get starting point: tier, interval Textgrid = Read from file: path$ + file$ - "wav" + "TextGrid" List = Create Strings as file list: "list", path$ + "*.wav" Here's your corrected script (untested): form Files And the initial form stores the path in the inputDir$ variable, but then you want to use one called path$ (in line 7). Then in line 45 you have the same problem: the sound_name$ variable (which you never use) will always be the same, because it is always the name of the first selected Sound object. It calculates the same values every time, stores those values in some variables, and then overwrites those variables the next time.Įvery time the loop runs, it is actually measuring the same Sound object, because each time you select all, and then commands like Get total duration work on the first selected appropriate object. The main problem is that the for loop in lines 31-43 doesn't actually do anything. Your script doesn't work because it's not doing what you think it is doing. Move end of selection to nearest zero crossing Move start of selection to nearest zero crossing #gets the ending point of the third quarter of the vowel #gets the the starting point of the second quarter of the vowel # Remembers how many pieces of sound where extracted # Labelled intervals are extracted from the original sound file and areĮxtract non-empty intervals. 1 Answer Sorted by: 0 I want to cut the segment from the speech file and then save it without it Its not clear what you want to do with the deleted segment. # Appends the ".TextGrid" extension to the string file$ and reads # Reads the sound file to the Objects list # Gets the name of the sound file to be worked out However, I don't get anything in my output folder, so I am obviously doing something wrong. The aim of the Speech Corpus Toolkit for Praat (SpeCT) is to provide an organized inventory of well-documented Praat scripts that can be easily downloaded, modified and used in order to perform small tasks during the various stages of building, organizing, annotating, analysing, searching and exporting data from a speech corpus. I came up with the following script based on other scripts I found online. Then I am adding 1/4 to the starting time and then 3/4 to the starting time to get the middle portion. In order to do this, I am cutting the vowel in 4 parts. I want to cut the half portion of this vowel and save it in another file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |