The approach used by https://github.com/boinkor-net/flac-tracksplit, i.e., directly copying frames, is a lot faster than decoding and re-encoding the PCM samples. The current implementation there stops at frame boundaries, but if my understanding is correct, we can decode the boundary frames, split the samples, and re-encode them (with the caveat that the new first frame may have fewer samples than allowed, so we may need to combine with the second frame and potentially split that to fit into the maximum samples limit).
The approach used by https://github.com/boinkor-net/flac-tracksplit, i.e., directly copying frames, is a lot faster than decoding and re-encoding the PCM samples. The current implementation there stops at frame boundaries, but if my understanding is correct, we can decode the boundary frames, split the samples, and re-encode them (with the caveat that the new first frame may have fewer samples than allowed, so we may need to combine with the second frame and potentially split that to fit into the maximum samples limit).