/* This function is the pcm output function, type is 0(PCM)  */
static uint32_t Stereo2Mono(void *audio_buf, uint32_t len, int LR)
/* This function is the pcm output function, type is 0(PCM)  */
static uint32_t Stereo2Mono(void *audio_buf, uint32_t len, int LR)
{
    if (!audio_buf || !len || len % 4) {
        printf( "%s arg err\n", __func__);
        return 0;
    }
    int16_t *buf = audio_buf;
    uint32_t i = 0;
    LR = LR ? 1 : 0;
    for (i = 0; i < len / 4; i++) {
        buf[i] = buf[i * 2 + LR];
    }
    return len / 2;
}