IPS-LMU / emuR

The main R package for the EMU Speech Database Management System (EMU-SDMS)
http://ips-lmu.github.io/EMU.html
23 stars 15 forks source link

Problem with convert_TextGridCollection(): Couldn't find a match for [intervals|points] #258

Closed qiangxiajinjin closed 1 year ago

qiangxiajinjin commented 2 years ago

I have a problem with converting TextGrids into the emuDB format. When I try the following code `

library(emuR)
pathCol = "~/MA-data/analyse/collection"
convert_TextGridCollection(pathCol,
                           dbName = "v2",
                           targetDir = "~/MA-data/analyse/collection")

for my data collection, I get the following error message:

in TextGridToBundleAnnotDFs(tgPath, sampleRate = 2000, name = "tmpBundleName", : Couldn't find a match for [intervals|points]:\s*size in ~/MAdata/analyse/collection/bg/bg_f_diapix1_m14m13_ch1.TextGrid!!! The first few lines of the current tier are (might help spot the error...): NA"

I don't understand why there is no match for the .TextGrid file, because I do have a .wav file sharing the same basename. Or does it mean something else rather than a wav counterpart?

list.files("~/MAdata/analyse/collection/bg") [1] "bg_f_diapix1_m14m13_ch1.TextGrid" "bg_f_diapix1_m14m13_ch1.wav" "bg_f_diapix1_m14m13_ch2.TextGrid" [4] "bg_f_diapix1_m14m13_ch2.wav"

I don't understand the error The first few lines of the current tier are (might help spot the error...): NA either. As far as I see in the mentioned TextGrid, the "lines" are not empty. Do I take the message wrong again?

Screenshot 2022-04-06 at 10 24 26
qiangxiajinjin commented 2 years ago

The reason why it does not work is probably that two tiernames in the TexgGrid are (almost) identical (one is uppercase and the other is lowercase). After I rename them, it works well 🥲

qiangxiajinjin commented 2 years ago

No, renaming tiers does not solve the problem. I got the same error message again... 😞 in TextGridToBundleAnnotDFs(tgPath, sampleRate = 2000, name = "tmpBundleName", : Couldn't find a match for [intervals|points]:\s*size in ~/MA-data/analyse/collection/bg/bg_f_diapix1_m14m13_ch1.TextGrid!!! The first few lines of the current tier are (might help spot the error...): NA

rpuggaardrode commented 1 year ago

This seems to be a problem with the 'short' TextGrid format. When you save a TextGrid from Praat, you'll get the option to "Save as text file..." or "Save as short text file...". I had the same issue and when I 'saved as text file' instead of 'as short text file', the problem was solved.

qiangxiajinjin commented 1 year ago

This seems to be a problem with the 'short' TextGrid format. When you save a TextGrid from Praat, you'll get the option to "Save as text file..." or "Save as short text file...". I had the same issue and when I 'saved as text file' instead of 'as short text file', the problem was solved.

Thanks a lot! It really solved my problem! Exactly the "short text file" caused the error.