0

i want to write a audio recording program using win32 WAVE API and then stream it. but i want to know how i can guess the number of WAVEHDR buffer for recording audio?

WAVEHDR mInputDeviceBuffer[NUM];

the value of NUM is needed. does it selected based on special formula or it is completely chosen by developer neeed?

4

1 回答 1

1

流式音频是实时操作,Windows 不是实时操作系统。弥合此差距所需的缓冲量是由于多任务处理而导致程序未执行时可能进入的音频数据量。如果您在录制时启动了其他操作,您的程序在 Windows 下需要等待多长时间?也许1-1.5秒。

因此,您需要多少缓冲区的答案取决于音频数据速率,以及您为缓冲区选择的大小,然后使它们足以覆盖最坏情况下的暂停时间,我的测试表明可能高达 1.5 秒。

于 2014-08-05T00:18:17.887 回答