kopia lustrzana https://github.com/sh123/codec2_talkie
35 wiersze
1.5 KiB
Java
35 wiersze
1.5 KiB
Java
package com.radio.opus;
|
|
|
|
import androidx.annotation.RequiresApi;
|
|
|
|
@RequiresApi(23)
|
|
public class Opus {
|
|
|
|
static {
|
|
System.loadLibrary("opus");
|
|
System.loadLibrary("OpusJNI");
|
|
}
|
|
|
|
// application
|
|
public static final int OPUS_APPLICATION_VOIP = 2048;
|
|
public static final int OPUS_APPLICATION_AUDIO = 2049;
|
|
public static final int OPUS_APPLICATION_RESTRICTED_LOWDELAY = 2051;
|
|
|
|
// frame sizes
|
|
public static final int OPUS_FRAMESIZE_2_5_MS = 5001; /**< Use 2.5 ms frames */
|
|
public static final int OPUS_FRAMESIZE_5_MS = 5002; /**< Use 5 ms frames */
|
|
public static final int OPUS_FRAMESIZE_10_MS = 5003; /**< Use 10 ms frames */
|
|
public static final int OPUS_FRAMESIZE_20_MS = 5004; /**< Use 20 ms frames */
|
|
public static final int OPUS_FRAMESIZE_40_MS = 5005; /**< Use 40 ms frames */
|
|
public static final int OPUS_FRAMESIZE_60_MS = 5006; /**< Use 60 ms frames */
|
|
public static final int OPUS_FRAMESIZE_80_MS = 5007; /**< Use 80 ms frames */
|
|
public static final int OPUS_FRAMESIZE_100_MS = 5008; /**< Use 100 ms frames */
|
|
public static final int OPUS_FRAMESIZE_120_MS = 5009; /**< Use 120 ms frames */
|
|
|
|
public native static long create(int sampleRate, int numChannels, int application, int bitrate, int complexity);
|
|
public native static int destroy(long con);
|
|
|
|
public native static int decode(long con, char[] in, short[] out, int frames);
|
|
public native static int encode(long con, short[] in, int frames, char[] out);
|
|
}
|