blob: 174280cc97e817c19a644df10a2c2b84e1e9090f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
## libsndfile Binding for the Ada Programming Language
This is a thick binding of [libsndfile](https://libsndfile.github.io/libsndfile/)
so effort has been made to get rid of all C-isms and C-specific types wherever
possible. In particular:
<ul>
<li>All error codes have been converted to exceptions</li>
<li>Void pointers are completely absent</li>
<li>The command API has been mapped to a more ordinary collection of
subprograms instead of the single function it is in C</li>
</ul>
The package hierarchy is as follows:
<ul>
<li>Libsndfile (Everything that isn't virtual IO or the command API)
<ul>
<li>Libsndfile.Commands (The command API datatypes and subprograms)</li>
<li>Libsndfile.Virtual (The virtual IO interface)</li>
</ul>
</li>
</ul>
A few short example programs are available in the `example` subdirectory.
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
Build time:
<ul>
<li>gcc</li>
<li>GNAT</li>
<li>GPRbuild</li>
<li>libsndfile</li>
</ul>
Run time:
<ul>
<li>libsndfile</li>
</ul>
#### Building and Installation
This repository is written to use the GNAT Project Manager build tools. To
build, use the following command
`gprbuild asndfile.gpr`
There is a single build switch of `-Xbuild` which can have a value of `release`
(the default) or `debug`.
To install the binding, use
`gprinstall -p -m asndfile.gpr`
The other gpr file `example.gpr` can be used to build the short example
programs provided.
For further information on the build tools, consult the
[GPRbuild docs](https://docs.adacore.com/gprbuild-docs/html/gprbuild_ug.html).
#### Credits and Licensing
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.
|