code: func SeemsValid(r io.Reader) bool {
  	d := New(r)
  	fr := &Frame{}
  	var frameDuration time.Duration
  	var duration time.Duration
  	var err error
  	var badFrames int
  	for {
  		err = d.Next(fr)
  		if err != nil {
  			badFrames++
  			if err == ErrInvalidHeader {
  				continue
  			}
  			break
  		}
  		// garbage needing to be skipped probably means bad frame
  		if fr.SkippedBytes > 20 {
  			badFrames++
  		}
  		frameDuration = fr.Duration()
  
  		if frameDuration > 0 {
  			duration += frameDuration
  		}
  		d.NbrFrames++
  	}
  	if err == io.EOF || err == io.ErrUnexpectedEOF || err == io.ErrShortBuffer {
  		err = nil
  	}
  	if d.NbrFrames <= 0 {
  		return false
  	}
  	percentBadFrames := (float64(badFrames) * 100) / float64(d.NbrFrames)
  	// more than 10% frames with issues or a zero/negative duration means bad file
  	if percentBadFrames > 10 {
  		return false
  	}
  	if duration <= 0 {
  		return false
  	}
  	return true
  }
docs: // SeemsValid checks if the mp3 file looks like a valid mp3 file by looking at the first few bytes.
  // The data can be corrupt but at least the header seems alright.
  // It is the caller's responsibility to rewind/close the reader when done.