Skip to contentSkip to conversation

RF6 app.(osk5912)

DISCUSSION ahmed adel 1 participant 1 message Jul 1, 2006

lore
Share & tools
lore

ahmed adel

author
#0 lore raw

the RF6 application of osk5912,

i want to configure it to get the sound
from mic not form (line in),

the configuration code on gpp side:

/*
* ======== configureCodec ========
* Configure the codec.
*/
static void configureCodec( int sampleFreq )
{
int ioctlarg;

   /* Open the codec */
   codecFd = open( CODEC_DEV, O_WRONLY, 0 );

if( codecFd == -1 ) {
terminateThread( "Error: Failed to open audio driver", AUDIOSTATE0
);
}

/* Configure the bits/sample in the driver */
ioctlarg = BITSPERSAMPLE;

   if( ioctl(codecFd, SNDCTL_DSP_SETFMT, &ioctlarg) == -1 ) {
       terminateThread( "Error: cannot set bits", AUDIOSTATE1 );
   }

/* Configure the number of audio channels in the data stream */
ioctlarg = STEREO; // AIC23 is a stereo codec

   if( ioctl(codecFd, SNDCTL_DSP_CHANNELS, &ioctlarg) == -1 ) {
       terminateThread( "Error: cannot set channels", AUDIOSTATE1 );
   }

/* Configure the speed of the data stream */
ioctlarg = sampleFreq;

   if( ioctl(codecFd, SNDCTL_DSP_SPEED, &ioctlarg) == -1 ) {
       terminateThread( "Error: cannot set speed", AUDIOSTATE1 );

}
return;
}