关于directshow 麦克风音频采集问题
我根据directshow sample的创建了一个capture 出来采集麦克风的输入,直接连上renderer实时播放,但总是有1s延时,我的设置是这样的。
// Find number of bytes in one second
long lBytesPerSecond = (long) (nBytesPerSample * nFrequency * nChannels);
// Set to 50ms worth of data , DEFAULT_BUFFER_TIME = 0.05
long lBufferSize = (long) ((float) lBytesPerSecond * DEFAULT_BUFFER_TIME);
ALLOCATOR_PROPERTIES prop={0};
prop.cbBuffer = lBufferSize;
prop.cBuffers = 6;
prop.cbAlign = nBytesPerSample * nChannels;
hr = pNeg->SuggestAllocatorProperties(&prop);