Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/safchain/sa_dsp

Android Jni interface to "ChunkWare Music Software" audio compressor/gate/limiter filters
https://github.com/safchain/sa_dsp

Last synced: 28 days ago
JSON representation

Android Jni interface to "ChunkWare Music Software" audio compressor/gate/limiter filters

Awesome Lists containing this project

README

        

sa_dsp
======

Android Jni interface to "ChunkWare Music Software" audio compressor/gate/limiter filters

Example:

```java
import sa.dsp.Compressor;
import sa.dsp.Gate;

public void record {
Compressor compressor = new Compressor();
compressor.setThresh(-10.0d);
compressor.setRatio(-4.0d);
compressor.initRuntime();

Gate gate = new Gate();
gate.setThresh(-36.0d);
gate.initRuntime();

int bufferSize = AudioRecord.getMinBufferSize(RECORDER_SAMPLERATE,
RECORDER_CHANNELS, RECORDER_AUDIO_ENCODING);

AudioRecord recorder = new AudioRecord(MediaRecorder.AudioSource.MIC,
RECORDER_SAMPLERATE, RECORDER_CHANNELS,
RECORDER_AUDIO_ENCODING, bufferSize);

recorder.startRecording();

short pcm[] = new short[bufferSize];

int read = 0;
while (true) {
read = recorder.read(pcm, 0, bufferSize);

if (read > 0 && AudioRecord.ERROR_INVALID_OPERATION != read) {
gate.process(read, pcm);
compressor.process(read, pcm);
}
}

recorder.stop();
recorder.release();
}
```