Skip to content

Commit

Permalink
Increase lag to 1 second
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagokokada committed Jan 16, 2024
1 parent 189b6c0 commit b7d01da
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions notification_sound.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ import (

const notificationSoundEnabled bool = true

// 1s/2 = 500ms of maximum lag, good enough for this use case and will use lower
// CPU, but need to compesate the lag with time.Sleep() to not feel "strange"
// (e.g.: "floaty" notifications because the sound comes too late)
const lag time.Duration = time.Second / 2
// Maximum lag, good enough for this use case and will use lower CPU, but need
// to compesate the lag with time.Sleep() to not feel "strange" (e.g.: "floaty"
// notifications because the sound comes too late).
// About as good we can get of CPU usage for now, until this issue is fixed:
// https://github.com/gopxl/beep/issues/137.
const lag time.Duration = time.Second

var (
buffer1 *beep.Buffer
Expand Down

0 comments on commit b7d01da

Please sign in to comment.