2013-02-04 07:29 AM
Hi , as quoted from the audio implemination of stm32f4 eval :
Mono audio streaming is not supported (in order to play mono audio streams, each data should be sent twice <
br
>on the I2S or should be duplicated on the source buffer. Or convert the stream in stereo before playing).
I cannot find any example or explanation on how to do it,does anyone have any clue how can i implement it?
I have mono files with frequency of 44100 ,and i want to play them with the same frequncey on stereo channel.
Thanks
Michael
2013-02-04 07:39 AM
// Duplicate the mono sample in both left and right channels
int16_t m[100]; // 100 mono samples
int16_t s[100 * 2]; // 100 stereo samples left/right channels interleaved
int i;
for(i=0; i<100; i++)
s[(i << 1) + 0] = s[(i << 1) + 1] = m[i]; // left[i] = right[i] = mono[i]