-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LinearFadeStrategy fails to detect fade completion for sub-second durations #268
Comments
Thanks for reporting and providing a propper solution! 👍 |
Sorry, I forgot to cover the case when _step is 0) - fade should finish immediately (probably a check should be added to StartFading so that no cycle is wasted to detect completion: if (Math.Abs(_step) <= 0.00001f) |
You mean after this line: cscore/CSCore/Streams/LinearFadeStrategy.cs Line 104 in 75242c9
we should add the check and eventually call StopFadingInternal() ?
I would suggest adding the following:
|
I rewrote StartFading like this to cover these edge cases:
|
Depending on sample frequency and specified fade duration (usually, < 500ms), fade volume increment step can become too large and _currentVolument will overshoot the _targetVolume. Fade completion never gets detected and volume keeps increasing infinitely. Here is the fix:
File: LinearFadeStrategy.cs
Original:
Fixed:
The text was updated successfully, but these errors were encountered: