package org.telegram.messenger.voip;

import android.media.AudioFormat;
import android.media.AudioManager;
import android.media.AudioTrack;

import java.nio.ByteBuffer;

/**
 * Created by grishka on 20.12.16.
 */

public class AudioTrackJNI{
    private AudioTrack audioTrack;
    private byte[] buffer=new byte[960*2];
    private boolean running;
    private Thread thread;
    private int bufferSize;
    private long nativeInst;
    private boolean needResampling;

    public AudioTrackJNI(long nativeInst) {
        this.nativeInst = nativeInst;
    }

    private int getBufferSize(int min, int sampleRate) {
        return Math.max(AudioTrack.getMinBufferSize(sampleRate, AudioFormat.CHANNEL_OUT_MONO, AudioFormat.ENCODING_PCM_16BIT), min);
    }

    public void init(int sampleRate, int bitsPerSample, int channels, int bufferSize) {

    }

    public void stop() {

    }

    public void release() {

    }

    public void start() {

    }

    private void startThread() {

    }

    private native void nativeCallback(byte[] buf);
}