You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: audio.go
    path of file: ./repos/termloop/extra
    
    the code of the file until where you have to start completion: package extra

// extras/audio.go

// This file provides types and functions for loading and playing audio.
// Please note that this is in termloop/extras because it has external
// dependencies - it won't work without PortAudio and libsndfile being
// installed on your system.

import (
	"github.com/gordonklaus/portaudio"
	"github.com/mkb218/gosndfile/sndfile"
)

// The Audio type
    
func (a *Audio) playCallback(out []float32) {
	for i := range out {
		var data float32

		for _, t := range a.tracks {
			if !t.playing {
				continue
			}
			if t.loop {
				data += (t.buffer[t.playhead%len(t.buffer)]) * t.volume
				t.playhead = (t.playhead + 1) % len(t.buffer)
			} else if t.playhead < len(t.buffer) {
				data += t.buffer[t.playhead] * t.volume
				t.playhead++
			} else {
				t.playing = false
				t.playhead = 0
			}
		}
		out[i] = data
	}
}