TeamNewPipe / NewPipe

A libre lightweight streaming front-end for Android.
https://newpipe.net
GNU General Public License v3.0
31.35k stars 3.05k forks source link

[FR] Add tweaks to 'fast-forward during silence' function #3082

Open CrimsonFork opened 4 years ago

CrimsonFork commented 4 years ago

This feature is amazing already, but I wish for a few options:

wb9688 commented 4 years ago

ExoPlayer skipping silence could only be enabled or disabled AFAIK: https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/PlaybackParameters.html#skipSilence

wb9688 commented 4 years ago

Hmm… not sure if we could do something custom by modifying https://github.com/google/ExoPlayer/blob/release-v2/library/core/src/main/java/com/google/android/exoplayer2/audio/SilenceSkippingAudioProcessor.java and passing that as another AudioProcessor. @Redirion: Do you happen to know more?

Redirion commented 4 years ago

Its a final class though. But I will take a look. Sounds like a reasonable feature especially for background playback which I personally use more often than video playback.

wb9688 commented 4 years ago

@Redirion: Copy-paste under a different name is a thing though, see also e.g. how we have https://github.com/TeamNewPipe/NewPipe/blob/dev/app/src/main/java/androidx/fragment/app/FragmentStatePagerAdapterMenuWorkaround.java. Make sure to keep the license header from ExoPlayer in that case though.

CrimsonFork commented 4 years ago

My biggest issue right now is that, while skipping, it doesn't play the audio, which it did in the early implementations. Now, that wouldn't be an issue if it only skipped absolute silence, but simply low volume is considered silence as well, making any speech that is not loud and clear ("dry") hard to understand or even inellegible in some cases.

cheintz commented 1 year ago

I was just looking for duplicate issues before creating a new issue for this feature request.

The current version is very aggressive in skipping and results in "drug commercial disclaimer-like" speech patterns. Perhaps good parameterization of silences to skip (or fast-forward through) is minimum silence time and silence speedup factor. So, for example, with a 0.5s minimum silence time and 5x speedup factor, silences of 0.5, 1.0, 1.5, 2 would last for 0.5, 0.6, 0.7, 0.8 seconds, respectively., Maybe also a max time, where silences that would end up longer than a threshold are just trimmed to that threshold.