Name Date Size #Lines LOC

..--

src/main/H25-Apr-2025-1,289907

README.mdH A D25-Apr-20251.4 KiB3724

build.gradleH A D25-Apr-2025936 3935

screenshot.pngHD25-Apr-202535.4 KiB

README.md

1LiveEffect Sample
2============
3
4This sample simply loops audio from input stream to output stream to demonstrate
5the usage of the 2 stream interfaces.
6
7Screenshots
8-----------
9
10![Screenshot](screenshot.png)
11
12
13### Stream Configurations
14- 48kHz
15- oboe::I16
16- stereo or mono
17
18### Customizing the App
19
20If you want to customize the effects processing then modify the
21onBothStreamsReady() method in "src/main/cpp/FullDuplexPass.h"
22
23### Caveats
24OpenES SL does not allow setting the recording or playback device.
25
26Synchronizing input and output streams for full-duplex operation is tricky. 
27
28Input and output have different startup times. The input side may have to charge up the microphone circuit.
29Also the initial timing for the output callback may be bursty as it fills the buffer up.
30So when the output stream makes its first callback, the input buffer may be overflowing or empty or partially full.
31
32In order to get into sync we go through a few phases.
33
34* In Phase 1 we always drain the input buffer as much as possible, more than the output callback asks for. When we have done this for a while, we move to phase 2.
35* In Phase 2 we optionally skip reading the input once to allow it to fill up with one burst. This makes it less likely to underflow on future reads.
36* In Phase 3 we should be in a stable situation where the output is nearly full and the input is nearly empty.  You should be able to run for hours like this with no glitches.
37