PDA

View Full Version : Directsound Capture/Output Buffers Not Playing Evenly


hocki101
04-10-2006, 12:43 PM
I am creating a program that uses Directsound to make 2 buffers (1 capture and 1 output). The buffers are 2 channels, 9600 bps, 16 bit/sample. Each buffer is 2 seconds long with 16 notification points.
Timing is very critical in my program. I have created a log tracking the output buffer's play cursor and capture buffer's capture cursor, and from one notification to the next, the difference in each is a multiple of 256. Every once in a while (at random it seems), however, the output buffer's cursor will move 128 bytes less than did the capture buffer's cursor. The cursors then travel at the same speed again, but now the latency for the sound is 128 bytes greater.
This appears to happen every 10 or 20 minutes with the output cursor getting further behind each time. The processing of the samples is quick enough so that the unlocked portion is not stretching into the sections being played/captured.

Does anyone have any ideas that could help me? Thanks in advance.

Brian

hocki101
04-11-2006, 06:47 AM
I changed the buffers to 1 channel, and the same thing is happening.

Now, the cursors typically move in multiples of 128 bytes, except when there is a glitch and the output buffer's cursor moves 64 bytes less than that of the capture buffer.

slismsami
06-30-2006, 04:40 AM
i don't know how to solve you're problem, but can you give me the source code, i can't properly create a buffer and record the sound captured without having an error in the execution

Reedbeta
06-30-2006, 05:46 AM
slismsami, this thread is a couple of months old. Please create a new thread in which to ask your question.