mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 12:08:58 +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
|
p.volume = volume
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Player) UnwrittenBufferSize() int64 {
|
func (p *Player) UnplayedBufferSize() int64 {
|
||||||
return int64(p.v.Get("unwrittenBufferSize").Int())
|
return int64(p.v.Get("unplayedBufferSize").Int())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Player) Close() error {
|
func (p *Player) Close() error {
|
||||||
|
@ -33,7 +33,7 @@ type readerDriverPlayer interface {
|
|||||||
Reset()
|
Reset()
|
||||||
Volume() float64
|
Volume() float64
|
||||||
SetVolume(volume float64)
|
SetVolume(volume float64)
|
||||||
UnwrittenBufferSize() int64
|
UnplayedBufferSize() int64
|
||||||
io.Closer
|
io.Closer
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ func (p *readerPlayer) Current() time.Duration {
|
|||||||
defer p.m.Unlock()
|
defer p.m.Unlock()
|
||||||
p.ensurePlayer()
|
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)
|
return time.Duration(sample) * time.Second / time.Duration(p.factory.sampleRate)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user