Loku is a simple audio stream API for Android using rxjava 2
Working on maven repository
- Download and import it. Right now you can do it manually
- Add permissions
<uses-permission android:name="android.permission.RECORD_AUDIO" />
- Use it
compositeDisposable = new CompositeDisposable();
// create a recorder
Recorder recorder = new Recorder(getApplicationContext());
compositeDisposable.add(recorder);
// create a player and subscribe it to the loku recorder
Player player = new Player(getApplicationContext());
compositeDisposable.add(
recorder.getAudioFlowable()
.observeOn(Schedulers.newThread())
.subscribeWith(player));
- Don't forget to unsubscribe
if (!compositeDisposable.isDisposed()) {
compositeDisposable.dispose();
}