2022-04-08 01:58 AM
I have been studying the x-cube-memsmic1's AMicArray_Microphones_Streaming example. I have used 4 channel mic array expansion module.
As per the theory, incoming data is from 4 channels, 16-bit slot size per channel, and 96khz sampling frequency. so the incoming data per millisecond should be of size 96000/1000 * 4 = 384 (uint16_t).
However, in the demo example, the AUDIO_OUTPUT_BUFF_SIZE has doubled the intended buffer size.
#define AUDIO_OUTPUT_BUFF_SIZE ((AUDIO_IN_SAMPLING_FREQUENCY/1000)*AUDIO_IN_CHANNELS*2)
My question is how the AUDIO_OUTPUT_BUFF_SIZE is calculated here?
Another question is incoming data are slot1, slot2, slot3 and slot4. and the data is in MSB first configuration with a 16-bit slot size. So can we extract per channel data in a separate buffer?
How can we further process it as it is in PCM format? Is there any documentation available for general steps to follow?