Config record mono audio in evkmimxrt1060_tensorflow_lite_kws

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Config record mono audio in evkmimxrt1060_tensorflow_lite_kws

1,104 Views
nahan_trogn
Contributor III

Hi NXP,

In evkmimxrt1060_tensorflow_lite_kws, the example uses stereo audio to predict. Because there is only 1 mic on board (right channel), so the left channel's value is 0.

I want to change config from Stereo to Mono. I had changed

From

SAI_GetClassicI2SConfig(&g_transceiverConfig, DEMO_AUDIO_BIT_WIDTH, kSAI_Stereo, kSAI_Channel0Mask)

to              

SAI_GetClassicI2SConfig(&g_transceiverConfig, DEMO_AUDIO_BIT_WIDTH,kSAI_MonoRight, kSAI_Channel0Mask)

.But I think I miss something in config (Because the time to get buffer full is double than the original config).

1. I think I had to reconfig clock or something else...?

2. I found SAI_RxSetBitClockRate(DEMO_SAI, DEMO_AUDIO_MASTER_CLOCK, DEMO_AUDIO_SAMPLE_RATE, DEMO_AUDIO_BIT_WIDTH,
DEMO_AUDIO_DATA_CHANNEL). What is this config used for? The DEMO_AUDIO_DATA_CHANNEL means? If I record mono, then the DEMO_AUDIO_DATA_CHANNEL = 1?

Thanks in advance.

Labels (1)
Tags (2)
0 Kudos
Reply
4 Replies

1,046 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello, 

To work in mono-right mode, you need to implement the following changes. 

1. Set the DEMO_AUDIO_DATA_CHANNEL to 2.

2. Set two channels as the input of the WM8960 like this:

wm8960Config.leftInputSource = kWM8960_InputDifferentialMicInput3,
wm8960Config.rightInputSource = kWM8960_InputDifferentialMicInput2;

3. Set the kSAI_MonoRight(01), this means that we will ignore the left word.

SAI_GetClassicI2SConfig(&g_transceiverConfig, DEMO_AUDIO_BIT_WIDTH, kSAI_MonoRight, kSAI_Channel0Mask);

I already made the tests on my end, and everything worked as expected. 

Regards,
Victor 

0 Kudos
Reply

1,085 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello, 

I'm checking this internally, I will provide you an update as soon as possible.

Regards,
Victor 

0 Kudos
Reply

1,060 Views
nahan_trogn
Contributor III

Hi, can you answer me now?

0 Kudos
Reply

1,082 Views
nahan_trogn
Contributor III

I look forward to hearing from you soon.

Thanks.

0 Kudos
Reply