I’m testing some simple audio playback on Android based on the Audio Player Tutorial. I’ve been getting some choppy/buffer overflow sounding audio, so now trying to use a TimeSliceThread and set a buffer size to try and get smooth playback, e.g.
transportSource.setSource (readerSource, 8192, &timeSliceThread, reader->sampleRate);
and I am also starting the thread in the class constructor.
However when I add the non-zero buffer size and
&timeSliceThread argument, the app stops in its tracks at this point in the log:
Audio device - min buffers: 8208, 640; 44100 Hz; input chans: 2 OpenSL: numInputChannels = 0, numOutputChannels = 2, nativeBufferSize = 1024, nativeSampleRate = 44100, actualBufferSize = 6144, audioBuffersToEnqueue = 4, sampleRate = 44100 Suspending all threads took: 15.044ms
Replacing the line as previous with
transportSource.setSource (readerSource, 0, nullptr, reader->sampleRate);
allows it to load again.