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