mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +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)
|
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.
|
||||||
|
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user