mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
audio: Rename UnwrittenBufferSize -> UnplayedBufferSize
This commit is contained in:
parent
6d442c0a17
commit
9e73b0d287
@ -175,8 +175,8 @@ func (p *Player) SetVolume(volume float64) {
|
||||
p.volume = volume
|
||||
}
|
||||
|
||||
func (p *Player) UnwrittenBufferSize() int64 {
|
||||
return int64(p.v.Get("unwrittenBufferSize").Int())
|
||||
func (p *Player) UnplayedBufferSize() int64 {
|
||||
return int64(p.v.Get("unplayedBufferSize").Int())
|
||||
}
|
||||
|
||||
func (p *Player) Close() error {
|
||||
|
@ -33,7 +33,7 @@ type readerDriverPlayer interface {
|
||||
Reset()
|
||||
Volume() float64
|
||||
SetVolume(volume float64)
|
||||
UnwrittenBufferSize() int64
|
||||
UnplayedBufferSize() int64
|
||||
io.Closer
|
||||
}
|
||||
|
||||
@ -142,7 +142,7 @@ func (p *readerPlayer) Current() time.Duration {
|
||||
defer p.m.Unlock()
|
||||
p.ensurePlayer()
|
||||
|
||||
sample := (p.src.Current() - p.player.UnwrittenBufferSize()) / bytesPerSample
|
||||
sample := (p.src.Current() - p.player.UnplayedBufferSize()) / bytesPerSample
|
||||
return time.Duration(sample) * time.Second / time.Duration(p.factory.sampleRate)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user