-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Adaptive Volume Threshold and speed like NewPipe does, or even better. #36
Comments
Hello there, sorry for only now coming back to you on this. Do you have any further resources, maybe even code samples, for such an algorithm or would be willing to try to implement this? I have created a new branch "dynamic-threshold" that holds the code needed around the dynamic threshold calculating code (adding a new setting, saving previous sample volumes etc.) but I don't really understand how your described algorithm should work. skip-silence/src/pages/content/lib/DynamicThresholdCalculator.ts Lines 34 to 38 in 88d7098
This would need to get replaced with a real implementation of your described algorithm. |
I've updated the implementation to be closer to what you've described. It will now slowly get to the volume of the lowest 10th percentile. This will be released as "beta" in Skip Silence 4 skip-silence/src/pages/content/lib/DynamicThresholdCalculator.ts Lines 39 to 49 in cc5b155
|
Wow, thanks a lot, man. I've also lost your message within a sea of other notifications. I'll test the implementation in the wild. |
It looks like ExoPlayer implements its Skip Silence functionality in https://github.com/google/ExoPlayer/blob/bd54394391/library/core/src/main/java/com/google/android/exoplayer2/audio/SilenceSkippingAudioProcessor.java, but I can't really find adaptive threshold code there. The code uses Maybe I'm overseeing something, NewPipe is implementing the dynamic threshold itself or its simply using a static threshold instead of dynamically updating the threshold based on the current volume. |
I have an error when installing in the Google Chrome browser: |
@AlexLev59 Wrong topic. |
Hello there, Bennett. Right to the point.
Would you be so kind to add an adaptive (dynamic) threshold option?
It's a part of software adaptive noise gates and dynamic range compressors in real-time digital signal processing for decades. Our task is also "real-time" processing. Presumably, no large preload or buffering needed yet.
The basic idea is to start with zero (silence) threshold and x1 speed gradually integrate the volume level of incoming samples , calculating the whole volume scale of the already played part: the highest integral level, the lowest integral level (noise/music) etc. The threshold gradually moves up to the calculated noise/music level during the whole playback. Moving back towards safe (0%) threshold has to be accelerated so no audio is lost when music/noise level dramatically decreased. Also the next trick with quiet audio speed slowdown comes handy.
Adaptive speed option can be very useful. Generally - the lower highest integral volume or (option) the higher the threshold over time is, the less FF speed is used for the user to hear better what was said.
Thanks in advance for your consideration.
The text was updated successfully, but these errors were encountered: