I meet a strange behaviour (for my understanding) of the MaiscBufferCopied callback for the CMdaAudioInputStream class.
In my app I acquire 320 bytes chunks of PCM audio, I encode them and send them to socket.
The program works and the streamed audio is perfect.
I make statistics of this process that I flush on file when I close streaming.
I've seen that between two acquistions my "timestamps" differs always of 15 millisecs and sometimes of 30. This is right because 320bytes of PCM correspond to 20 millisecs of audio but the system tick of my 6630 is only 1/64 of sec (about 15 millisecs) so apart from some fluctuations (due to variable load for other processes on the phone) the count is right.
BUT by inspecting this statistics I've found that SOMETIMES (one every 100 samples or more) two subsequent callbacks differ for 0!
How can they return at the same time since i call a new ReadL() INSIDE MaiscBufferCopied and i log every callback as soon as it happens (see below)?
void CNewStreamAdapter::MaiscBufferCopied(TInt aError, const TDesC8& aBuffer)
if(&aBuffer == ipcmbuffer)
iBufferInUse = 0;
iBufferInUse = 1;
TCodecProcessResult result = codecpcm2XEnc->ProcessL(*itmpPCM, *itemp_XEnc);
iSocket.SendTo(*itemp_XEnc, remoteAddress, 0, iStatus);
Thanks in advance