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:
Hajime Hoshi 2022-03-25 20:27:13 +09:00
parent 9bfbbb6e9e
commit 0e8c423e51
2 changed files with 0 additions and 17 deletions

View File

@ -399,11 +399,6 @@ func (p *Player) SetVolume(volume float64) {
p.p.SetVolume(volume) 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. // SetBufferSize adjusts the buffer size of the player.
// If 0 is specified, the default buffer size is used. // 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. // A small buffer size is useful if you want to play a real-time PCM for example.

View File

@ -286,18 +286,6 @@ func (p *playerImpl) Err() error {
return p.player.Err() 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) { func (p *playerImpl) SetBufferSize(bufferSize int) {
p.m.Lock() p.m.Lock()
defer p.m.Unlock() defer p.m.Unlock()