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

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