cannam@85: cannam@85: cannam@85: cannam@85: cannam@85: cannam@85: Secret Rabbit Code (aka libsamplerate) cannam@85: cannam@85: cannam@85: cannam@85: cannam@85: cannam@85: cannam@85: cannam@85: cannam@85: cannam@85: cannam@85:
cannam@85: SRC.png cannam@85:
cannam@85: cannam@85:
cannam@85: cannam@85: cannam@85: cannam@85: cannam@85: cannam@85: cannam@85: cannam@85: cannam@85:
cannam@85:
cannam@85: cannam@85: cannam@85:
cannam@85:
cannam@85: cannam@85:

Applications Programming Interface

cannam@85:

cannam@85: The publically callable functions of libsamplerate are all listed in the cannam@85: <samplerate.h> header file. cannam@85: In order to use any of the functionality of libsamplerate, you need to add cannam@85:

cannam@85:
cannam@85: 	#include <samplerate.h>
cannam@85: 
cannam@85:

cannam@85: to the top of any function that call any of the following functions. cannam@85: You will also need to link you binary with the libsamplerate library. cannam@85:

cannam@85:

cannam@85: The API allows three methods for accessing the capabilies of the library: cannam@85:

cannam@85:
    cannam@85:
  • A simple interface which can sample rate convert cannam@85: a single block of samples (one or more channels) in one go. cannam@85: The simple API is less capable than the full API. cannam@85:
  • A more fully featured interface which allows time cannam@85: varying sample rate conversion on streaming data (again one or more cannam@85: channels). cannam@85:
  • A callback interface which has the same cannam@85: functionality as the interface above but allows the details of input and cannam@85: output to be separated. cannam@85: The output is generated by call a read function and the library calls a user cannam@85: supplied callback function to obtain its input. cannam@85: This interface is particularly well suited to applications where the output cannam@85: sample rate is varied with time. cannam@85:
cannam@85: cannam@85:

cannam@85: NB : All three access methods are able to process multi channel interleaved cannam@85: data. cannam@85:

cannam@85: cannam@85:

cannam@85: The parts of the API which are common to all three interfaces are: cannam@85:

cannam@85: cannam@85:

cannam@85: All three versions of the API are restricted to operating on buffers of ISO C cannam@85: Standard float data. cannam@85: However, there are two cannam@85: auxillary functions cannam@85: for converting arrays of float data to and from short data. cannam@85:

cannam@85: cannam@85:

cannam@85: Note: The tests/ and examples/ directories of the source code cannam@85: distribution contain numerous example programs showing the use of the library. cannam@85:

cannam@85: cannam@85: cannam@85: cannam@85: cannam@85: cannam@85:
cannam@85:
cannam@85: cannam@85: cannam@85: