After implementing audio loopback (from the microphone input to standard output) in Android using the Superpowered SDK I found that the output was only heard through one side of the headset.
This is how I initialised the SuperpoweredAndroidAudioIO:
audioIO = new SuperpoweredAndroidAudioIO (
samplerate, // sampling rate
buffersize, // buffer size
true, // enableInput
true, // enableOutput
liveAudioProcessing, // process callback function
process, // clientData
-1 , // inputStreamType (-1 = default)
-1, // outputStreamType (-1 = default)
buffersize * 2 // latencySamples
);
Switching the inputStreamType or outputStreamType to other options in SLES/OpenSLES_AndroidConfiguration.h did not help to resolve the issue.
My liveAudioProcessing callback function looks like this:
static bool liveAudioProcessing (
void * clientdata, // custom pointer to processing bool
short int *audio, // buffer of interleaved samples
int numberOfFrames, // number of frames to process
int __unused samplerate // sampling rate
) {
SuperpoweredShortIntToFloat(audio, floatBuffer, (unsigned int)numberOfFrames);
if (*(bool *) clientdata and eq != nullptr) {
eq->process(floatBuffer, floatBuffer, (unsigned int) numberOfFrames);
}
SuperpoweredFloatToShortInt(floatBuffer, audio, (unsigned int)numberOfFrames);
return true;
}
The problem occurs when both clientdata is false and true, it has thus nothing to do with the equalizer.