annotate src/portaudio_20140130/bindings/java/jportaudio.dox @ 81:7029a4916348

Merge build update
author Chris Cannam
date Thu, 31 Oct 2019 13:36:58 +0000
parents 7ddb4fc30dac
children
rev   line source
Chris@39 1 /**
Chris@39 2 @page java_binding JPortAudio Java Binding
Chris@39 3 @ingroup jportaudio
Chris@39 4
Chris@39 5 <i>Note: this page has not been reviewed, and may contain errors.</i>
Chris@39 6
Chris@39 7 @section java_draft DRAFT - IN PROGRESS
Chris@39 8
Chris@39 9 9/4/12 JPortAudio is very new and should be considered an "alpha" release.
Chris@39 10 The building of JPortAudio will eventually be integrated into the Makefile as an optional build.
Chris@39 11
Chris@39 12 Currently JPortAudio is only supported for Windows and Macintosh. Please contact us if you want to help with porting Linux.
Chris@39 13
Chris@39 14 For reference documentation of the JPortAudio API see: com.portaudio.PortAudio
Chris@39 15
Chris@39 16 For an example see: PlaySine.java
Chris@39 17
Chris@39 18 @section java_comp_windows Building JPortAudio on Windows
Chris@39 19
Chris@39 20 Build the Java code using the Eclipse project in "jportaudio". Export as "jportaudio.jar".
Chris@39 21
Chris@39 22 If you modify the JNI API then you will need to regenerate the JNI .h files using:
Chris@39 23
Chris@39 24 @code
Chris@39 25 cd bindings/java/scripts
Chris@39 26 make_header.bat
Chris@39 27 @endcode
Chris@39 28
Chris@39 29 Build the JNI DLL using the Visual Studio 2010 solution in "java/c/build/vs2010/PortAudioJNI".
Chris@39 30
Chris@39 31 @section java_use_windows Using JPortAudio on Windows
Chris@39 32
Chris@39 33 Put the "jportaudio.jar" in the classpath for your application.
Chris@39 34 Place the following libraries where they can be found, typically in the same folder as your application.
Chris@39 35
Chris@39 36 - portaudio_x86.dll
Chris@39 37 - portaudio_x64.dll
Chris@39 38 - jportaudio_x86.dll
Chris@39 39 - jportaudio_x64.dll
Chris@39 40
Chris@39 41 @section java_comp_max Building JPortAudio on Mac
Chris@39 42
Chris@39 43 These are notes from building JPortAudio on a Mac with 10.6.8 and XCode 4.
Chris@39 44
Chris@39 45 I created a target of type 'C' library.
Chris@39 46
Chris@39 47 I added the regular PortAudio frameworks plus the JavaVM framework.
Chris@39 48
Chris@39 49 I modified com_portaudio_PortAudio.h and com_portaudio_BlockingStream.h so that jni.h could found.
Chris@39 50
Chris@39 51 @code
Chris@39 52 #if defined(__APPLE__)
Chris@39 53 #include <JavaVM/jni.h>
Chris@39 54 #else
Chris@39 55 #include <jni.h>
Chris@39 56 #endif
Chris@39 57 @endcode
Chris@39 58
Chris@39 59 This is bad because those header files are autogenerated and will be overwritten.
Chris@39 60 We need a better solution for this.
Chris@39 61
Chris@39 62 I had trouble finding the "libjportaudio.jnilib". So I added a Build Phase that copied the library to "/Users/phil/Library/Java/Extensions".
Chris@39 63
Chris@39 64 On the Mac we can create a universal library for both 32 and 64-bit JVMs. So in the JAR file I will open "jportaudio" on Apple. ON WIndows I will continue to open "jportaudio_x64" and "jportaudio_x86".
Chris@39 65 */