We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4fabdd8 commit a3a27d0Copy full SHA for a3a27d0
driver_winmm_windows.go
@@ -18,6 +18,7 @@ import (
18
"errors"
19
"fmt"
20
"sync"
21
+ "time"
22
"unsafe"
23
24
"golang.org/x/sys/windows"
@@ -323,6 +324,10 @@ func (c *winmmContext) appendBuffers() {
323
324
switch {
325
case errors.Is(err, _MMSYSERR_NOMEM):
326
continue
327
+ case errors.Is(err, _MMSYSERR_NODRIVER):
328
+ sleep := time.Duration(float64(time.Second) * float64(len(c.buf32)) / float64(c.channelCount) / float64(c.sampleRate))
329
+ time.Sleep(sleep)
330
+ return
331
case errors.Is(err, windows.ERROR_NOT_FOUND):
332
// This error can happen when e.g. a new HDMI connection is detected (#51).
333
// TODO: Retry later.
0 commit comments