libresample outputs the exact number of frames
(http://www.mega-nerd.com/SRC/api_simple.html), but
unfortunately the included command line app,
sndfile-resample, only takes a rate/amount argument.
However, it's probably just a one-liner patch to modify
the source for sndfile-resample to take exact
number of frames instead, so that's what I would do.