diff --git a/audio/audio.go b/audio/audio.go index dd000b3d1..223424bb2 100644 --- a/audio/audio.go +++ b/audio/audio.go @@ -190,8 +190,8 @@ type Context struct { players *players driver *driver.Player sampleRate int - frames int - writtenBytes int + frames int64 + writtenBytes int64 } var ( @@ -247,7 +247,7 @@ func (c *Context) Update() error { } c.frames++ bytesPerFrame := c.sampleRate * bytesPerSample * channelNum / ebiten.FPS - l := (c.frames * bytesPerFrame) - c.writtenBytes + l := (c.frames * int64(bytesPerFrame)) - c.writtenBytes l &= mask c.writtenBytes += l buf := make([]byte, l) diff --git a/internal/loop/run.go b/internal/loop/run.go index d81cc4df5..ad01bb4ed 100644 --- a/internal/loop/run.go +++ b/internal/loop/run.go @@ -32,7 +32,7 @@ type runContext struct { fps int currentFPS float64 runningSlowly bool - frames int + frames int64 lastUpdated int64 lastFPSUpdated int64 m sync.RWMutex