Skip to content
Snippets Groups Projects
Commit e24ecbe3 authored by tobias's avatar tobias
Browse files

Inital commit NativeAudio

parent 08e312fd
Branches
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="test"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="output" path="bin"/>
</classpath>
/bin/
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>PlayWallNative</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
File added
package de.tobias.playpad;
public class NativeAudio {
public static native void play(int id);
public static native void pause(int id);
public static native void stop(int id);
public static native double getVolume(int id);
public static native void setVolume(int id, double volume);
public static native void load(int id, String path);
public static native void dispose(int id);
public static native double getDuration(int id);
public static native double getPosition(int id);
}
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class de_tobias_playpad_NativeAudio */
#ifndef _Included_de_tobias_playpad_NativeAudio
#define _Included_de_tobias_playpad_NativeAudio
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: de_tobias_playpad_NativeAudio
* Method: play
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_de_tobias_playpad_NativeAudio_play
(JNIEnv *, jclass, jint);
/*
* Class: de_tobias_playpad_NativeAudio
* Method: pause
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_de_tobias_playpad_NativeAudio_pause
(JNIEnv *, jclass, jint);
/*
* Class: de_tobias_playpad_NativeAudio
* Method: stop
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_de_tobias_playpad_NativeAudio_stop
(JNIEnv *, jclass, jint);
/*
* Class: de_tobias_playpad_NativeAudio
* Method: getVolume
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL Java_de_tobias_playpad_NativeAudio_getVolume
(JNIEnv *, jclass, jint);
/*
* Class: de_tobias_playpad_NativeAudio
* Method: setVolume
* Signature: (ID)V
*/
JNIEXPORT void JNICALL Java_de_tobias_playpad_NativeAudio_setVolume
(JNIEnv *, jclass, jint, jdouble);
/*
* Class: de_tobias_playpad_NativeAudio
* Method: load
* Signature: (ILjava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_de_tobias_playpad_NativeAudio_load
(JNIEnv *, jclass, jint, jstring);
/*
* Class: de_tobias_playpad_NativeAudio
* Method: dispose
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_de_tobias_playpad_NativeAudio_dispose
(JNIEnv *, jclass, jint);
/*
* Class: de_tobias_playpad_NativeAudio
* Method: getDuration
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL Java_de_tobias_playpad_NativeAudio_getDuration
(JNIEnv *, jclass, jint);
/*
* Class: de_tobias_playpad_NativeAudio
* Method: getPosition
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL Java_de_tobias_playpad_NativeAudio_getPosition
(JNIEnv *, jclass, jint);
#ifdef __cplusplus
}
#endif
#endif
package de.tobias.playpad;
public class NativeAudioTest {
public static void main(String[] args) {
System.load("/Users/tobias/Documents/Programmieren/Java/eclipse/PlayWallNative/libNativeAudio.dylib");
NativeAudio.load(0, "/Users/tobias/Downloads/03%20Hymn%20For%20The%20Weekend.mp3.wav");
System.out.println(NativeAudio.getDuration(0));
NativeAudio.play(0);
while (true) {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment