Skip to content

Commit

Permalink
Add sleep before calling speakerSuspend()
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagokokada committed Jan 24, 2024
1 parent 99cee2c commit 9da0dfc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/sound/sound.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ func PlaySendNotification(endCallback func()) {

speaker.Play(beep.Seq(
buffer1.Streamer(0, buffer1.Len()),
// https://github.com/gopxl/beep/issues/137#issuecomment-1908845253
beep.Callback(func() { time.Sleep(lag) }),
beep.Callback(speakerSuspend),
beep.Callback(endCallback),
))
Expand All @@ -55,6 +57,8 @@ func PlayCancelNotification(callback func()) {

speaker.Play(beep.Seq(
buffer2.Streamer(0, buffer2.Len()),
// https://github.com/gopxl/beep/issues/137#issuecomment-1908845253
beep.Callback(func() { time.Sleep(lag) }),
beep.Callback(speakerSuspend),
beep.Callback(callback),
))
Expand Down

0 comments on commit 9da0dfc

Please sign in to comment.