音频PCM数据,单声道变双声道
int single2Double(char *pData, int nSize){unsigned short szBuf[4096];unsigned short *pst = (unsigned short*)pData;memset(szBuf, 0, sizeof(szBuf));memcpy(szBuf, pData, nSize);for (int i = 0; i < nSize; i++){if (i % 2 == 0) { pst[i] = szBuf[i / 2];}else {pst[i] = pst[i - 1]; } } return nSize * 2;}
如果觉得《音频单声道变双声道》对你有帮助,请点赞、收藏,并留下你的观点哦!