textgrid icon indicating copy to clipboard operation
textgrid copied to clipboard

Default rounding induces length mismatch

Open maxrmorrison opened this issue 2 years ago • 1 comments

While rounding may be useful for some applications, it harms others.

Consider audio at 22050 Hz sampling rate with length 74751 samples. With a hopsize of 256 samples and padding such that each frame is centered at hopsize / 2, 3 * hopsize / 2, 5 * hopsize / 2, etc., this should yield 291 frames. With the current default rounding, it produces 292 frames and is misaligned with other features I use. Because rounding cannot be turned off, I cannot fix this while using this library in its current state.

I think rounding should be optional. I also think that it should not be the default system behavior.

maxrmorrison avatar Mar 15 '23 14:03 maxrmorrison

You're welcome to have at it. It maybe should floor instead, I don't know.

(In general I am not really interested in maintaining this anymore---I rarely work with speech data and I have at least a dozen higher-priority devleopment projects---so if you want to change behavior I would really recommend just forking it and doing your own thing.)

kylebgorman avatar Mar 15 '23 14:03 kylebgorman