func NewPCMByteBuffer(data []byte, format *Format) *PCMBuffer {
	return &PCMBuffer{
		Format: format,
		Type:   Byte,
		Bytes:  data,
	}
}
NewPCMByteBuffer returns a new PCM buffer backed by the passed float samples
package audio
import (
	"bytes"
	"encoding/binary"
	"errors"
)
var (
	ErrInvalidBuffer = errors.New("invalid buffer")
)
type DataType int
const (
	Unknown DataType = iota
	Integer
	Float
	Byte
)
type Format struct {
	NumChannels int
	SampleRate int
	BitDepth int
	Endianness binary.ByteOrder
}
type PCMBuffer struct {
	Format *Format
	Ints []int
	Floats []float64
	Bytes []byte
	Type DataType
	framePos int64
}
func NewPCMIntBuffer(data []int, format *Format) *PCMBuffer {
	return &PCMBuffer{
		Format: format,
		Type:   Integer,
		Ints:   data,
	}
}
func NewPCMFloatBuffer(data []float64, format *Format) *PCMBuffer {
	return &PCMBuffer{
		Format: format,
		Type:   Float,
		Floats: data,
	}
}