aboutsummaryrefslogtreecommitdiff


libsndfile Binding for the Ada Programming Language
===================================================


Overview
--------

This is a thick binding, so effort has been made to get rid of all C-isms and
C-specific types wherever possible. In particular:

 * All error codes have been converted to exceptions
 * Void pointers are completely absent
 * The command API has been mapped to a more ordinary collection of subprograms
   instead of the single function it is in C

The package hierarchy is as follows:

 * Libsndfile: Everything that isn't virtual IO or the command API
   * Libsndfile.Commands: The command API datatypes and subprograms
   * Libsndfile.Virtual: The virtual IO interface

A few short example programs are available in /example/.

Please note that at the moment this binding is incomplete, as the RIFF chunk
API is not bound. If anyone has a pressing need for it let me know.

Finally, there appears to be a subtle bug in the virtual IO that causes the
frame count to be one lower than it should be. I am currently unsure of the
exact cause. Since the behaviour is the same regardless of whether using the
virtual IO in C or in Ada, the likely culprit is in the library itself.


Dependencies
------------

An Ada 2012 compiler and standard library (build)
A C compiler and standard library (build)
gprbuild (build)
libsndfile (run)


Build Instructions
------------------

Ensure that all dependencies are installed, including any developer or header
packages for libsndfile. Then the following commands will build and install the
binding:

    gprbuild libsndfile.gpr
    gprinstall -p -m libsndfile.gpr

The other gpr file, example.gpr, can be used to build the few short example and
test programs provided.


Further Information
-------------------

C API of libsndfile:
https://libsndfile.github.io/libsndfile/api.html


Credits and Legal
-----------------

This binding and the Ada test/example programs were written by Jedidiah Barber.

All code of this binding and example programs is released into the public
domain. Consult unlicense.txt for further information.