Hello

I am modifying the AudioFlinger code exactly before the point where
audio data is written to hardware. I see that on the dev phone, I
receive 2400 audio frames every time in a loop which is written to the
hardware after mixing.

I want to pre-process the audio data and my audio library requires
exact multiples of 128 audio frames(64 left + 64 right). I start
processing the audio data 128 frames at a time as follows.

128 *18 = 2304 (processed 2304 audio frames)
2400 - 2304  = 96.

This leaves me with 96 frames at the end as it is not a multiple of
128.
Now I write this 2304 processed audio frames into the hardware and
store the remaining 96 frames in a buffer. The next time I receive
2400 frames again, I process them as follows:

96 + 2400 = 2496 (total number of frames with me)
128 * 19 = 2432 (processed audio frames in multiples of 128, these
2432 frames are written into hardware)
2496 - 2432 = 64 (64 frames at the end are once again put into buffer)

Now my problem is that every time I write less than 2400 frames into
the hardware, there is a disturbance in the audio. This degrades the
audio quality a lot as the processing takes place continuously in a
loop.

Is it a requirement that I should always write 2400 frames into the
hardware or should it be a multiple of some fixed value? Is there a
solution to this problem?

Regards
Goutam
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting
-~----------~----~----~----~------~----~------~--~---

Reply via email to