code: func (b *PCMBuffer) Size() (numFrames int) {
  	if b == nil || b.Format == nil {
  		return 0
  	}
  	numChannels := b.Format.NumChannels
  	if numChannels == 0 {
  		numChannels = 1
  	}
  	switch b.DataType {
  	case Integer:
  		numFrames = len(b.Ints) / numChannels
  	case Float:
  		numFrames = len(b.Floats) / numChannels
  	case Byte:
  		sampleSize := int((b.Format.BitDepth-1)/8 + 1)
  		numFrames = (len(b.Bytes) / sampleSize) / numChannels
  	}
  	return numFrames
  }
docs: // Size returns the number of frames contained in the buffer.