Jump to content


Directsound Capture/Output Buffers Not Playing Evenly


3 replies to this topic

#1 hocki101

    New Member

  • Members
  • Pip
  • 2 posts

Posted 10 April 2006 - 06: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

#2 hocki101

    New Member

  • Members
  • Pip
  • 2 posts

Posted 11 April 2006 - 12:47 PM

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.

#3 slismsami

    New Member

  • Members
  • Pip
  • 1 posts

Posted 30 June 2006 - 10: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

#4 Reedbeta

    DevMaster Staff

  • Administrators
  • 4782 posts
  • LocationBellevue, WA

Posted 30 June 2006 - 11:46 AM

slismsami, this thread is a couple of months old. Please create a new thread in which to ask your question.
reedbeta.com - developer blog, OpenGL demos, and other projects





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users