Search in sources :

Example 1 with Sonic

use of org.vinuxproject.sonic.Sonic in project Prestissimo by TheRealFalcon.

the class Track method initDevice.

private void initDevice(int sampleRate, int numChannels) {
    mLock.lock();
    final int format = findFormatFromChannels(numChannels);
    final int minSize = AudioTrack.getMinBufferSize(sampleRate, format, AudioFormat.ENCODING_PCM_16BIT);
    mTrack = new AudioTrack(AudioManager.STREAM_MUSIC, sampleRate, format, AudioFormat.ENCODING_PCM_16BIT, minSize * 4, AudioTrack.MODE_STREAM);
    mSonic = new Sonic(sampleRate, numChannels);
    mLock.unlock();
}
Also used : Sonic(org.vinuxproject.sonic.Sonic) AudioTrack(android.media.AudioTrack)

Aggregations

AudioTrack (android.media.AudioTrack)1 Sonic (org.vinuxproject.sonic.Sonic)1