mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
Revert "audio: add (*Player).UnplayedBufferSize (#2021)"
This reverts commit 7744013b05
.
Reason: This is no longer needed and SetBufferSize is enough.
Updates #2020
Updates #2026
This commit is contained in:
parent
9bfbbb6e9e
commit
0e8c423e51
@ -399,11 +399,6 @@ func (p *Player) SetVolume(volume float64) {
|
||||
p.p.SetVolume(volume)
|
||||
}
|
||||
|
||||
// UnplayedBufferSize returns the amount of unplayed data in the player's buffer in the time duration.
|
||||
func (p *Player) UnplayedBufferSize() time.Duration {
|
||||
return p.p.UnplayedBufferSize()
|
||||
}
|
||||
|
||||
// SetBufferSize adjusts the buffer size of the player.
|
||||
// If 0 is specified, the default buffer size is used.
|
||||
// A small buffer size is useful if you want to play a real-time PCM for example.
|
||||
|
@ -286,18 +286,6 @@ func (p *playerImpl) Err() error {
|
||||
return p.player.Err()
|
||||
}
|
||||
|
||||
func (p *playerImpl) UnplayedBufferSize() time.Duration {
|
||||
p.m.Lock()
|
||||
defer p.m.Unlock()
|
||||
|
||||
if p.player == nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
samples := p.player.UnplayedBufferSize() / bytesPerSample
|
||||
return time.Duration(samples) * time.Second / time.Duration(p.factory.sampleRate)
|
||||
}
|
||||
|
||||
func (p *playerImpl) SetBufferSize(bufferSize int) {
|
||||
p.m.Lock()
|
||||
defer p.m.Unlock()
|
||||
|
Loading…
Reference in New Issue
Block a user