Current returns the current position.
()
| 268 | |
| 269 | // Current returns the current position. |
| 270 | func (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 |
| 279 | func (p *Player) GetVolume() float64 { |