在这个例程中PCM_Buffer[]数组中存储的是采集的语音信息,我想试一下直接通过串口把这个数组中的数据发送到电脑,然后分析。按照程序中看PCM_Buffer数组中奇数为为一声道,偶数为为另一声道。在例程中有
uint8_t CDC_Fill_Buffer(uint8_t* Buf, uint32_t TotalLen)函数可以输出,但是PCM_Buffer是uint16。在程序中进行了转化,为什么调试的时候变量变成了char型呢
- uint16_t audio_out1[AUDIO_IN_BUF_LEN / 2];
- uint8_t audio_out1_H[AUDIO_IN_BUF_LEN / 2];
- uint8_t audio_out1_L[AUDIO_IN_BUF_LEN / 2];
- void AudioProcess(void)
- ...
- for(indexIn=0;indexIn<AUDIO_IN_BUF_LEN;indexIn++)
- {
- audio_out_buffer[IndexOut++] = PCM_Buffer[indexIn];
- audio_out_buffer[IndexOut++] = PCM_Buffer[indexIn];
-
- /*add*/
- audio_out1[audio_out_index] = PCM_Buffer[indexIn];
- audio_out1_H[audio_out_index] = (uint8_t) (PCM_Buffer[audio_out_index] >> 8);
- audio_out1_L[audio_out_index] = (uint8_t) (PCM_Buffer[audio_out_index]);