Skip to content

Conversation

@a-shtefan
Copy link

@a-shtefan a-shtefan commented Aug 12, 2025

ExoPlayer allows controlling silence skipping by adjusting the silence duration that is removed by SilenceSkippingAudioProcessor. The default behavior with the default parameters for this component makes it hard to listen to content because it leaves almost no pauses. After this commit it is possible to adjust silence length that remains and shorten only long pauses.

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

  • allows changing silence duration which remains after fast forwarding

Before/After Screenshots/Screen Record

  • Before:
  • After:

Fixes the following issue(s)

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.

Due diligence

ExoPlayer allows controlling silence skipping by adjusting the silence duration
that is removed by `SilenceSkippingAudioProcessor`.
The default behavior with the default parameters for this component makes it
hard to listen to content because it leaves almost no pauses. After this commit
it is possible to adjust silence length that remains and shorten only long
pauses.
@github-actions github-actions bot added the size/medium PRs with less than 250 changed lines label Aug 12, 2025
@lawson85
Copy link

Looking forward to this!

@a-shtefan
Copy link
Author

Do I need to fix/change anything? It's been over 2 months, which is a lot for a tiny change, and there is zero feedback

@AudricV AudricV added feature request Issue is related to a feature in the app player Issues related to any player (main, popup and background) niche Only relevant to a very small amount of people labels Oct 22, 2025
@AudricV AudricV self-requested a review October 22, 2025 07:07
Copy link
Member

@AudricV AudricV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your pull request and sorry for the late reply.

Even if we don't accept new features (see the README), as the refactor branch will use NewPlayer with Media3 at some point, I think we can make an exception for this PR.

Code looks almost good to me, you should provide a way to reset the value set by the user.

Comment on lines +303 to +307
final SilenceSkippingAudioProcessor silenceSkippingAudioProcessor =
new SilenceSkippingAudioProcessor(
MILLISECONDS.toMicros(maxSilenceDurationMillis),
MILLISECONDS.toMicros(maxSilenceDurationMillis),
SilenceSkippingAudioProcessor.DEFAULT_SILENCE_THRESHOLD_LEVEL);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For reference for NewPlayer, this approach has been changed in Media3.

I would remove the duplicate call to MILLISECONDS.toMicros(maxSilenceDurationMillis) by saving the result in a variable.

Can you explain why you set the same value to minimumSilenceDurationUs and paddingSilenceUs?

* load video extension libraries is not needed in our case and has been removed. This should be
* changed in the case an extension is shipped with the app, such as the AV1 one.
* </p>
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JavaDoc of this class should be updated.

Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this nice addition! Sorry for the late review from my side, too. I haven't had enough time to keep up with the various PRs lately.

I agree with @AudricV, I think this can be merged as it's rather small and shouldn't introduce issues.

app:singleLineTitle="false"
app:iconSpaceReserved="false"/>

<SeekBarPreference
Copy link
Member

@Stypox Stypox Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder whether this should go to the playback parameters dialog, so it's easily accessible from the player, and it also does not clutter settings. And there it should be shown only when "Fast-forward during silence" is enabled, to further reduce clutter for users that don't enable "Fast-forward during silence". Let me know what you think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request Issue is related to a feature in the app niche Only relevant to a very small amount of people player Issues related to any player (main, popup and background) size/medium PRs with less than 250 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add user-facing settings for configuring the parameters of the skip-silence feature

4 participants