This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

dm365音频播放的问题



大家好,我用的dvsdk版本是4.02的.音频用alsa的驱动.

在跑demo encode中关于音频部分的时候会有这么一个问题:第一次运行程序时将mode参数设置为sAttrs.mode = Sound_Mode_FULLDUPLEX;并在Sound_read后加入以下代码,录音后紧接着播放:

/* write samples to the Sound device */

       if (Sound_write(hSound, hInBuf) < 0) {

           ERR("Failed to read speech buffer\n");

           cleanup(THREAD_FAILURE);

       }

这样跑音频是正常的.

第二次运行把播放函数Sound_write屏蔽,只录音,可这时候却有声音播放出来,声音的数据像是上次运行程序退出时残留在buffer中的数据.

如何才能解决这个bug?