DSPRelated.com
Forums

Audio Output Errors

Started by thed...@yahoo.com September 2, 2008
I recently got all of my code to work properly and display normal behavior in the watch window, so I'm beginning to listen to the output of the program. As I expected would probably happen, the output is not correct.

To run simple testing, I place the following lines at the beginning of my program

for(i = 0; i < dwNumNewSamples; i++){
while (!PEP5416_AIC23_read16(hCodec, &buffer[i]));
}

for(i = 0; i < dwNumNewSamples; i++){
while (!PEP5416_AIC23_write16(hCodec, buffer[i]));
}

This of course works fine on its own. I then add a function I wish to use on the incoming samples, and it shouldn't change the output, since the incoming samples are being written out (I actually use the added function to modify the value of some dummy variable). It however results in an output that has interference and sounds "scratchy" (if that makes sense...). I'm not really sure how this error occurs, though the code from the function somehow has to be messing up the program memory or the stack.

Does anyone have any idea why this incident might occur?