MCPcopy Index your code
hub / github.com/EngoEngine/engo / Current

Method Current

common/audio_player.go:270–276  ·  view source on GitHub ↗

Current returns the current position.

()

Source from the content-addressed store, hash-verified

268
269// Current returns the current position.
270func (p *Player) Current() time.Duration {
271 sample := int64(0)
272 p.sync(func() {
273 sample = p.pos / bytesPerSample / channelNum
274 })
275 return time.Duration(sample) * time.Second / time.Duration(p.sampleRate)
276}
277
278// GetVolume gets the Player's volume
279func (p *Player) GetVolume() float64 {

Callers 1

TestAudioPlayerSeekFunction · 0.80

Calls 1

syncMethod · 0.95

Tested by 1

TestAudioPlayerSeekFunction · 0.64