Skip to content

Commit

Permalink
#52 Use 1.01 instead of 1 for playback speed to remove clicking
Browse files Browse the repository at this point in the history
  • Loading branch information
vantezzen committed Jul 1, 2021
1 parent eb11a3c commit a5de47a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/pages/content/lib/SilenceSkipper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,15 @@ export default class SilenceSkipper {
* Attempts to change the video playback rate
*/
_setPlaybackRate(rate: number) {
this._targetPlaybackRate = rate
this._targetPlaybackRate = rate;

if (rate === 1) {
// Setting the speed to exactly 1 will cause audio clicking
// Setting the speed to slightly greater than 1 will prevent this from happening
// Related: https://github.com/vantezzen/skip-silence/issues/52
this._targetPlaybackRate = 1.01;
}

this.element.playbackRate = this._targetPlaybackRate;
if (!this._handlingRateChangeError) {
// Make sure that the playback rate actually changed
Expand Down

0 comments on commit a5de47a

Please sign in to comment.