[src] Fix sample rounding errors in extract-segments (#3321)
With a segments file constructed from exact wave file durations some segments came out one sample short. The reason is the multiplication of the float sample frequency and double audio time point is inexact. For example, float 8000.0 multiplied by double 2.03 yields 16239.99999999999, one LSB short of the correct sample number 16240. Also changed all endpoint calculations so that they performed in seconds, not sample numbers, as this does not require a conversion in nearly every comparison, and report positions in diagnostic messages also in seconds, not sample numbers.
Loading
Please register or sign in to comment