Closed fsuettmann closed 4 years ago
Sorry that I haven't had time to look at this yet. I am bulldozing towards a deadline beginning of next week. Will def. look at it then! Sorry about the delay
There is no rush, you may take your time.
Just stated working on it now but thanks to a new build system of R 4.0.0 under Windows I am still trying to get my build system working on my home-office machine ;-) #yayBreakingChanges!
Ok just a quick update (still no fix but getting closer):
add_ssffTrackDefinition(db_temp,
name = "fm",
onTheFlyFunctionName = "forest")
sl_formant <- get_trackdata(db_temp, seglist = error_mau[3,],
onTheFlyFunctionName = "forest",
# onTheFlyParams = formal_params,
verbose = T)
The issue is due to the sample rates (and one other value) of on the fly calcs being slightly different than when read from file (this is the first time I have noticed this). And by slightly I mean really slightly: `199.54751131221718196684 vs. 199.54751131221701143659`. What is causing this I am not fully sure, but I guess it could have to do with the sample rate being stored as a character string with limited precision in the SSFF files. Your fix would be a "hacky" work-around for this issue but that might be what we have to do. I'd like to investigate a bit more to see if I can't fix the root of the issue....
Thank you for pointing this out.
Regarding the sampling rates: This is also what I noticed but couldn't find an easy fix for the sampling rates. The proposed fix is surely more a workaround than a solution. I'm not sure if it would work with all cases the function is designed for.
So after a deep dive into the C code of the libassp I think the best thing to do is just to go with your solution as it nicely try catches everything and we can also issue a warning that something might be a bit fishy. The issue is caused due to slight rounding errors within the C-lib due to the data types used and also guestimating floats from strings. Fixing this would be a nightmare and I don't think it is worth it right now. Anyway, thanks heaps for the pull request and pointing out this issue!
Thank you! I'm glad I was able to contribute and issuing a warning sounds like a good idea.
A solution we hat for an issue with the get_trackdata() function. It feels more like a bodge and might not work for other situations but ours due to fSampleRateInMS.