fillBuffer fills the specified OpenAL buffer with next decoded data and queues the buffer to this player source
(buf uint32)
| 354 | // fillBuffer fills the specified OpenAL buffer with next decoded data |
| 355 | // and queues the buffer to this player source |
| 356 | func (p *Player) fillBuffer(buf uint32) error { |
| 357 | |
| 358 | // Reads next decoded data |
| 359 | n, err := p.af.Read(p.pdata, playerBufferSize) |
| 360 | if err != nil { |
| 361 | return err |
| 362 | } |
| 363 | // Sends data to buffer |
| 364 | //log.Debug("BufferData:%v format:%x n:%v rate:%v", buf, p.af.info.Format, n, p.af.info.SampleRate) |
| 365 | al.BufferData(buf, uint32(p.af.info.Format), p.pdata, uint32(n), uint32(p.af.info.SampleRate)) |
| 366 | al.SourceQueueBuffers(p.source, buf) |
| 367 | return nil |
| 368 | } |
no test coverage detected