audio: Rename UnwrittenBufferSize -> UnplayedBufferSize

This commit is contained in:
Hajime Hoshi 2021-03-01 01:27:42 +09:00
parent 6d442c0a17
commit 9e73b0d287
2 changed files with 4 additions and 4 deletions

View File

@ -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 {

View File

@ -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)
}