update Oto to v3.0.0-alpha.2

This commit is contained in:
Hajime Hoshi 2023-07-30 16:05:17 +09:00
parent d3d095ac98
commit 5f1d1ec412
4 changed files with 6 additions and 6 deletions

View File

@ -86,7 +86,7 @@ func (p *dummyPlayer) SetVolume(volume float64) {
p.volume = volume
}
func (p *dummyPlayer) UnplayedBufferSize() int {
func (p *dummyPlayer) BufferedSize() int {
return 0
}

View File

@ -29,7 +29,7 @@ type player interface {
IsPlaying() bool
Volume() float64
SetVolume(volume float64)
UnplayedBufferSize() int
BufferedSize() int
Err() error
SetBufferSize(bufferSize int)
io.Seeker
@ -251,7 +251,7 @@ func (p *playerImpl) Current() time.Duration {
return 0
}
samples := (p.stream.Current() - int64(p.player.UnplayedBufferSize())) / bytesPerSampleInt16
samples := (p.stream.Current() - int64(p.player.BufferedSize())) / bytesPerSampleInt16
return time.Duration(samples) * time.Second / time.Duration(p.factory.sampleRate)
}

2
go.mod
View File

@ -3,7 +3,7 @@ module github.com/hajimehoshi/ebiten/v2
go 1.18
require (
github.com/ebitengine/oto/v3 v3.0.0-alpha.1
github.com/ebitengine/oto/v3 v3.0.0-alpha.2
github.com/ebitengine/purego v0.5.0-alpha
github.com/go-text/typesetting v0.0.0-20230717141307-09c70c30a055
github.com/hajimehoshi/bitmapfont/v3 v3.0.0

4
go.sum
View File

@ -1,6 +1,6 @@
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/ebitengine/oto/v3 v3.0.0-alpha.1 h1:179m7zA+RI95RHomdYXO3HBcm18PA1lwJ/AjQfDxeI0=
github.com/ebitengine/oto/v3 v3.0.0-alpha.1/go.mod h1:50zY546V7eVjIb6+jZGPrcSG64nGfKqDgPnwFft05o0=
github.com/ebitengine/oto/v3 v3.0.0-alpha.2 h1:j5Eglr6LHBH/5FE/b6EuZG5a0sC9W8Srbmc2iXmWCqk=
github.com/ebitengine/oto/v3 v3.0.0-alpha.2/go.mod h1:50zY546V7eVjIb6+jZGPrcSG64nGfKqDgPnwFft05o0=
github.com/ebitengine/purego v0.5.0-alpha h1:pNZNC8WofBTN3Nm196An50C5taL/87BhFR/RzKy2o4k=
github.com/ebitengine/purego v0.5.0-alpha/go.mod h1:ah1In8AOtksoNK6yk5z1HTJeUkC1Ez4Wk2idgGslMwQ=
github.com/go-text/typesetting v0.0.0-20230717141307-09c70c30a055 h1:aUv3DYpk2eraRoyB7QZkyxgTVF7DrWcUui93iFRYO+8=