void
CodecRead()
{ DSK5416_PCM3002_CodecHandle hCodec; hCodec = DSK5416_PCM3002_openCodec(0,&Config);
for (sample = 0; sample < SINE_TABLE_SIZE; sample++)
{
/* read a sample from the Codec channel */
while(!DSK5416_PCM3002_read16(hCodec, &SpeechInput[sample]));
/*storing in the input buffer */
//sinetable[sample]=input;
/* Send a sample to the left channel */
while (!DSK5416_PCM3002_write16(hCodec,SpeechInput[sample]));
/* Send a sample to the right channel */
while (!DSK5416_PCM3002_write16(hCodec,SpeechInput[sample]));
}
DSK5416_PCM3002_closeCodec(hCodec); This is part of a code I'm trying to understand. What its doing here is taking audio samples and sending it into the headphone output. But I have a few doubts. 1. how can the same line of code send a signal to a right channel and left channel audio output just because it is written twice? /* Send a sample to the left channel */
while (!DSK5416_PCM3002_write16(hCodec,SpeechInput[sample]));
/* Send a sample to the right channel */
while (!DSK5416_PCM3002_write16(hCodec,SpeechInput[sample]));
2. DSK5416_PCM3002_CodecHandle hCodec- what does this command imply?
Thanks in advance.