Change Speed 'New Length' not accurate anymore

Howdy and thank yall - loving the update!
Long time audacity user - one of my absolute favorite features is the ‘Change Speed’ effect ‘New length’ setting. I produce shows for radio a lot, and it is so handy for me to take file that is very close to my desired length, and use the ‘change speed → new length’ effect to set it to EXACTLY the length I want.

That appears to be slightly off in the most recent audacity.

Whatever length I enter in the ‘New Length’ field, I get a different result in the audio output.

Audacity version: 3.2.0
Downloaded from: I let audacity update itself via the in-program dialog
OS: macOS Monterey 12.5.1 (21G83)
What I am trying to do: Change the length of a file to a different precise sample length
What is preventing me: When I enter in a new length (hh:mm:ss:samples), the result output is not what I entered

Steps to reproduce:

    1. Open audacity
  1. Click generate menu → generate chirp
  2. Set duration to 2 minutes exactly (00h 02m 00s + 00000 samples)
  3. Click ‘generate’ button
  4. Double-click audio region to ensure length is 00h 02m 00s + 00000 samples (might need to change your display settings to see samples)
  5. Click Effect->Change Speed
  6. Set new duration to 00h 03m 00s + 00000 samples (might need to change your display settings to see samples)
  7. Click ‘Apply’ button
  8. Double-click audio region to see length
  9. note that length is 00h 02m 59s + 44060 samples, not 00h 03m 00s + 00000 samples

I know its not a huge error, but it seems to be more drastic the longer the file is (ie. a 2-second file changed to 3-seconds results in a region that it is actually 00h 00m 02s + 44099 samples long… just 1 sample off), so this indicates something is just not right somewhere in the chain like a rounding error that gets redone a bunch.

Thank yall so much for taking a look at this!

Thanks for the bug report. I can confirm that the bug happens for me too (Ubuntu 20.04, Audacity 3.2.0).

I’ve logged it here: https://github.com/audacity/audacity/issues/3688

Thanks for that!
Hopefully not too much trouble.

Thank yall