while debugging some audio problems I saw some lines of code that
may be wrond/problematic:
PortAudioRenderer/process(...) - audio level processing loop
at line ~520: this modifies the buffer but does not take the offest
into the buffer into account (always starts at "i = 0"). Ususally
the offset is zero thus it works. However, this may change .
The following code snippet is strange:
for (i = 0; i < numberOfWrites; i++)
errorCode = Pa_WriteStream(paStream, data, frames);
if ((paNoError != errorCode) && (errorCode != paOutputUnderflowed))
data += framesInBytes;
Have a look at the error check just before the break statement: Usually
Pa_WriteStream returns paNoError (rarely Underflowed): thus this "if" check
evaluates to false and AudioQualityImprovement is done, but in this case
for data that was already handed over to portaudio - thus "after the fact".
Is this correct? What is the real proposed behaviour for this code?
AudioImprovment should be done before Pa_WriteStream()?