"Find Clipping" shows wrong number of samples in the labels
- Dominant language
- C++
- Stars
- 18.4k
- Forks
- 2.7k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 85
Description
### Bug description
When using Find Clipping, the count of the clipping samples displayed in the labels, doesn't match the actual number.
### Steps to reproduce
1. Delete PluginSettings.cfg to get default effect settings
2. Generate Chirp with default settings
3. Amplify by 3 dB with Allow Clipping
4. View -> Show Clipping on
5. Analyze > Find Clipping
6. See the count of samples displayed in the labels
7. Select all clipping samples and see the length in the Selection toolbar set to samples display
### Expected behavior
The number in the label matches the one in the selection toolbar.
### Actual behavior
The displayed count is off by one. The label says the clipping part has one length in samples, but the selection toolbar below has a different number of samples:

### Audacity Version
current master / alpha / nightly build
### Operating system
Other
### Additional context
From #
Contributor guide
Research direction
Reproduce the issue by deleting PluginSettings.cfg, generating a default Chirp, amplifying by 3 dB with Allow Clipping, and using Show Clipping and Analyze > Find Clipping. Compare the clipping count in the labels with the sample length shown in the Selection toolbar. Done means both counts match for this case and the relevant tests or checks pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100