code: func (d *Decoder) Seek(offset int64, whence int) (int64, error) {
  	npos := int64(0)
  	switch whence {
  	case io.SeekStart:
  		npos = offset
  	case io.SeekCurrent:
  		npos = d.pos + offset
  	case io.SeekEnd:
  		npos = d.Length() + offset
  	default:
  		panic(fmt.Sprintf("mp3: invalid whence: %v", whence))
  	}
  	d.pos = npos
  	d.buf = nil
  	d.frame = nil
  	f := d.pos / consts.BytesPerFrame
  	// If the frame is not first, read the previous ahead of reading that
  	// because the previous frame can affect the targeted frame.
  	if f > 0 {
  		f--
  		if _, err := d.source.Seek(d.frameStarts[f], 0); err != nil {
  			return 0, err
  		}
  		if err := d.readFrame(); err != nil {
  			return 0, err
  		}
  		if err := d.readFrame(); err != nil {
  			return 0, err
  		}
  		d.buf = d.buf[consts.BytesPerFrame+(d.pos%consts.BytesPerFrame):]
  	} else {
  		if _, err := d.source.Seek(d.frameStarts[f], 0); err != nil {
  			return 0, err
  		}
  		if err := d.readFrame(); err != nil {
  			return 0, err
  		}
  		d.buf = d.buf[d.pos:]
  	}
  	return npos, nil
  }
docs: // Seek is io.Seeker's Seek.
  //
  // Seek panics when the underlying source is not io.Seeker.