My goal is to play a local file when recording a microphone with a low latency microphone. I came to the Superpowered library because from the documentation it provides a low latency function. I created a player using SuperpoweredAdvancedAudioPlayer and SuperpoweredAndroidAudioIO and it works great.
SuperpoweredAndroidAudioIO has a constructor with parameters boolean enableInput, boolean enableOutput . I am currently using enableInput == false and enableOutput == true. When I believe these parameters - no effect.
I wonder if it is possible to simultaneously record a file and play another file?
There is also a SuperpoweredRecorder class in the library, but it is not talking about writing directly to disk. And you need to use the createWAV, fwrite, closeWAV methods. I tried to implement the recorder separately, but the quality is not very good (it is two to three times faster than real recording + the sound accelerates). Here is the simplest piece of code for the record I used:
void SuperpoweredFileRecorder::start(const char *destinationPath) { file = createWAV(destinationPath, sampleRate, 2); audioIO = new SuperpoweredAndroidAudioIO(sampleRate, bufferSize, true, false, audioProcessing, NULL, bufferSize);
I probably can't use Superpowered for this purpose and should just record with OpenSL ES directly.
Thanks in advance!
source share