MCPcopy
hub / github.com/g3n/engine / fillBuffer

Method fillBuffer

audio/player.go:356–368  ·  view source on GitHub ↗

fillBuffer fills the specified OpenAL buffer with next decoded data and queues the buffer to this player source

(buf uint32)

Source from the content-addressed store, hash-verified

354// fillBuffer fills the specified OpenAL buffer with next decoded data
355// and queues the buffer to this player source
356func (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}

Callers 2

PlayMethod · 0.95
runMethod · 0.95

Calls 3

BufferDataFunction · 0.92
SourceQueueBuffersFunction · 0.92
ReadMethod · 0.80

Tested by

no test coverage detected