code: func (d *Decoder) PCMBuffer(buf *audio.PCMBuffer) error {
  	if buf == nil {
  		return nil
  	}
  
  	if !d.pcmDataAccessed {
  		err := d.FwdToPCM()
  		if err != nil {
  			return d.err
  		}
  	}
  
  	// TODO: avoid a potentially unecessary allocation
  	format := &audio.Format{
  		NumChannels: int(d.NumChans),
  		SampleRate:  int(d.SampleRate),
  		BitDepth:    int(d.BitDepth),
  		Endianness:  binary.BigEndian,
  	}
  
  	bytesPerSample := (d.BitDepth-1)/8 + 1
  	sampleBufData := make([]byte, bytesPerSample)
  	decodeF, err := sampleDecodeFunc(int(d.BitDepth))
  	if err != nil {
  		return fmt.Errorf("could not get sample decode func %v", err)
  	}
  
  	// Note that we populate the buffer even if the
  	// size of the buffer doesn't fit an even number of frames.
  	for i := 0; i < len(buf.Ints); i++ {
  		_, err = d.PCMChunk.Read(sampleBufData)
  		if err != nil {
  			break
  		}
  		buf.Ints[i] = decodeF(sampleBufData)
  	}
  	if err == io.EOF {
  		err = nil
  	}
  	buf.Format = format
  	if buf.DataType != audio.Integer {
  		buf.DataType = audio.Integer
  	}
  
  	return err
  }
docs: // PCMBuffer populates the passed PCM buffer