Chris@32
|
1
|
Chris@32
|
2 jVamp -- a Java host interface for Vamp audio analysis plugins
|
Chris@32
|
3 ==============================================================
|
Chris@32
|
4
|
Chris@50
|
5 Chris Cannam, 2012-2015
|
Chris@32
|
6 http://code.soundsoftware.ac.uk/projects/jvamp
|
Chris@32
|
7
|
Chris@32
|
8 jVamp is a JNI (Java Native Interface) library that permits Java
|
Chris@32
|
9 applications to load and use Vamp audio analysis plugins.
|
Chris@32
|
10
|
Chris@35
|
11 See http://vamp-plugins.org/ for more information about Vamp plugins
|
Chris@35
|
12 and for plugin downloads.
|
Chris@35
|
13
|
Chris@35
|
14 Note that jVamp is intended to be compatible with the Android NDK as
|
Chris@35
|
15 well as desktop Java, though it hasn't been tested there (and existing
|
Chris@35
|
16 binary distributions of plugins do not usually include ARM builds).
|
Chris@35
|
17
|
Chris@32
|
18 Vamp plugins are native-code plugins typically written in C++. In
|
Chris@32
|
19 order to load them into a Java application, you need a native wrapper
|
Chris@32
|
20 library (that is, jVamp) and both the wrapper and the plugin need to
|
Chris@32
|
21 be compiled natively for the machine platform you are using.
|
Chris@32
|
22
|
Chris@34
|
23
|
Chris@34
|
24 In this directory
|
Chris@34
|
25 -----------------
|
Chris@34
|
26
|
Chris@34
|
27 org/vamp_plugins -> Java interface for jVamp
|
Chris@34
|
28 src/ -> C++ source code for jVamp JNI wrapper
|
Chris@34
|
29 host/ -> Simple Vamp host implemented as Java application
|
Chris@34
|
30 test/ -> Self-contained basic exercise test
|
Chris@34
|
31
|
Chris@34
|
32
|
Chris@34
|
33 Example
|
Chris@34
|
34 -------
|
Chris@34
|
35
|
Chris@47
|
36 On Linux or OS/X
|
Chris@34
|
37
|
Chris@47
|
38 1. Run "make" (on Linux) or "make -f Makefile.osx" (on OS/X) to build
|
Chris@47
|
39 the classes (jvamp.jar) and JNI wrapper (libvamp-jni.so or .dylib).
|
Chris@34
|
40
|
Chris@34
|
41 2. Build the host:
|
Chris@34
|
42
|
Chris@34
|
43 $ javac -classpath jvamp.jar host/host.java
|
Chris@34
|
44
|
Chris@34
|
45 3. Pick a Vamp plugin (which must be installed in the Vamp plugin
|
Chris@34
|
46 path) and a 16-bit PCM WAV file, and run the host. For example:
|
Chris@34
|
47
|
Chris@34
|
48 $ java -classpath jvamp.jar:host host vamp-example-plugins:fixedtempo:tempo testfile.wav
|
Chris@34
|
49
|
Chris@34
|
50 You should see some output -- in the case of the above plugin,
|
Chris@34
|
51 it will be one line of the form
|
Chris@34
|
52
|
Chris@34
|
53 0.002902494, 9.999092970: 142.07474 142.1 bpm
|
Chris@34
|
54
|
Chris@35
|
55 Note that you need the native-code libvamp-jni.so in your Java load
|
Chris@35
|
56 path in order to run a host using jVamp, and it must have been built
|
Chris@35
|
57 for the proper platform. Bear this in mind when planning to distribute
|
Chris@35
|
58 software using jVamp!
|
Chris@35
|
59
|
Chris@35
|
60
|
Chris@37
|
61 License
|
Chris@37
|
62 -------
|
Chris@37
|
63
|
Chris@37
|
64 This code is freely redistributable under a "new-style BSD" licence.
|
Chris@37
|
65 See the file COPYING for more details.
|
Chris@37
|
66
|
Chris@37
|
67
|
Chris@35
|
68 Any questions? Contact me at cannam@all-day-breakfast.com.
|
Chris@35
|
69
|