jonkatz2 / monitoR

5 stars 0 forks source link

sample rate and overlap check in corMatch, binMatch fails when FALSE #2

Open jonkatz2 opened 6 years ago

jonkatz2 commented 6 years ago

from ryan nolan via email:

Error in !all.equal(template@t.step, t.step, tolerance = t.step/10000) : 
  invalid argument type
dbrooks3 commented 5 years ago

I was wondering if there is a solution to this error. I have also received the error when using corMatch but have been unable to find a solution.

jonkatz2 commented 5 years ago

There are two parts to this error; first, there is an error in your sound files, and then there is an error in how the package handles reporting your error. You can solve the first one by making sure the sample rate of your template clip and survey match. If necessary you can resample either one using monitoR::changeSampRate().

sashahafner commented 5 years ago

Fixed nonsense error message with commit b5b6fcf9f4ce9696b37c6843558c3d2e121cd757.

ChelseaD9 commented 5 years ago

Hi, I have also received this error when using corMatch, but my sample rates match: Error in !all.equal(template@t.step, t.step, tolerance = t.step/10000) : invalid argument type

I am guessing my time steps don't match? I am quite sure what that means or how to go about fixing it. Any advice would be great!

Thank you!

Chelsea

ChelseaD9 commented 5 years ago

I fixed it, the error was in my sound files. When I initially read in my WAV files I used to=INF as an argument. Once I changed the argument from INF to a number it worked fine. Example:

Does not work: clipB <- readWave(filename =ClipB, from = 1, to = INF, units = "seconds",header = FALSE, toWaveMC = NULL)

Works great: clipB <- readWave(filename =ClipB, from = 1,to = 5,units = "seconds",header = FALSE, toWaveMC = NULL)

jonkatz2 commented 5 years ago

Hi Chelsea, Thanks for letting us know. I'm sure others will have this issue too.