Have a look at a demo program using libsndfile : sfprocess.c
Try the demo programs :
prompt > sndfile_info ~/IADSPL/AudioFiles/slap_bass.wav prompt > sfplay ~/IADSPL/AudioFiles/slap_bass.wav