Chris@39: /**
Chris@39: @page java_binding JPortAudio Java Binding
Chris@39: @ingroup jportaudio
Chris@39:
Chris@39: Note: this page has not been reviewed, and may contain errors.
Chris@39:
Chris@39: @section java_draft DRAFT - IN PROGRESS
Chris@39:
Chris@39: 9/4/12 JPortAudio is very new and should be considered an "alpha" release.
Chris@39: The building of JPortAudio will eventually be integrated into the Makefile as an optional build.
Chris@39:
Chris@39: Currently JPortAudio is only supported for Windows and Macintosh. Please contact us if you want to help with porting Linux.
Chris@39:
Chris@39: For reference documentation of the JPortAudio API see: com.portaudio.PortAudio
Chris@39:
Chris@39: For an example see: PlaySine.java
Chris@39:
Chris@39: @section java_comp_windows Building JPortAudio on Windows
Chris@39:
Chris@39: Build the Java code using the Eclipse project in "jportaudio". Export as "jportaudio.jar".
Chris@39:
Chris@39: If you modify the JNI API then you will need to regenerate the JNI .h files using:
Chris@39:
Chris@39: @code
Chris@39: cd bindings/java/scripts
Chris@39: make_header.bat
Chris@39: @endcode
Chris@39:
Chris@39: Build the JNI DLL using the Visual Studio 2010 solution in "java/c/build/vs2010/PortAudioJNI".
Chris@39:
Chris@39: @section java_use_windows Using JPortAudio on Windows
Chris@39:
Chris@39: Put the "jportaudio.jar" in the classpath for your application.
Chris@39: Place the following libraries where they can be found, typically in the same folder as your application.
Chris@39:
Chris@39: - portaudio_x86.dll
Chris@39: - portaudio_x64.dll
Chris@39: - jportaudio_x86.dll
Chris@39: - jportaudio_x64.dll
Chris@39:
Chris@39: @section java_comp_max Building JPortAudio on Mac
Chris@39:
Chris@39: These are notes from building JPortAudio on a Mac with 10.6.8 and XCode 4.
Chris@39:
Chris@39: I created a target of type 'C' library.
Chris@39:
Chris@39: I added the regular PortAudio frameworks plus the JavaVM framework.
Chris@39:
Chris@39: I modified com_portaudio_PortAudio.h and com_portaudio_BlockingStream.h so that jni.h could found.
Chris@39:
Chris@39: @code
Chris@39: #if defined(__APPLE__)
Chris@39: #include
Chris@39: #else
Chris@39: #include
Chris@39: #endif
Chris@39: @endcode
Chris@39:
Chris@39: This is bad because those header files are autogenerated and will be overwritten.
Chris@39: We need a better solution for this.
Chris@39:
Chris@39: 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:
Chris@39: 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: */