Is there any processing needed to playback audio? I am new to audio processing. I wrote a simple real-time playback program (when you speak on the mic your voice is immediately played on the output), however it is not working. I am using a 8Hz ADC with 128 frame size, and I output these 128 samples directly to audio PWM. It doesn't play the audio even though there's a "reaction" when you tap the mic.

Is there a processing needed before outputing the samples, that would explain why it isn't working ?

Here is my main loop : 

while (1) {

while (ADCChannelIsBusy(MyADCHandle)){}
ADCChannelRead  (MyADCHandle, Frame, ADC_BUFFER_SIZE);
while(OCPWMIsBusy(MyDACHandle));
OCPWMWrite  (MyDACHandle,Frame, OCPWM_FRAME_SIZE);


}

I wrote none of these functions, all were found in the dsPic starter Kit. Frame is the array where samples are stored.
This is unlikely to be a signal processing question. This is about the internals of the dsPic's firmware libraries and would be more suitable on another stackexchange site.

Things that could go wrong:


ADC input and PWM output might have a different data format (for example 12-bit right justified for the ADC, 8-bit for the PWM). You might need to scale / offset the data.
ADC_BUFFER_SIZE and OCPWM_FRAME_SIZE might be of different sizes, requiring you to use an intermediate buffer and counters to keep track of data pouring in/out of this buffer. Or, if the implementation allows it, you might instead read/write partial buffers of a smaller size - identical for both calls.