AnsweredAssumed Answered

RT1050 WM8960 codec - change audio parameters

Question asked by PazDim PazDim on Jul 7, 2018


I am using RT1050 evk with WM8960 codec for audio playback. SDK example plays 16 khz 16bit stereo sound. Its working good - I created corresponding raw audio file and transmit it to EVK via ethernet. But I need to work with 8 khz 16bit mono sound. Default configuration from example:

/* Clock pre divider for sai1 clock source */
/* Clock divider for sai1 clock source */
/* Get frequency of sai1 clock */


format.bitWidth = kSAI_WordWidth16bits; = 0U;
format.sampleRate_Hz = kSAI_SampleRate16KHz;
format.masterClockHz = DEMO_SAI_CLK_FREQ;
format.protocol = config.protocol;
format.stereo = kSAI_Stereo;
format.isFrameSyncCompact = false;
format.watermark = FSL_FEATURE_SAI_FIFO_COUNT / 2U;

What parameters do I need to change? I tried to set sampleRate_HZ to 8KHz, stereo to kSAI_MonoRight. But I do not understand the CLOCK parameters. How do I calculate them? The frequency of transmitting is reduced by 4 times (16khz to 8khz and stereo to mono) and the playback frequency is reduced by 2 times (16khz to 8khz), right?