Re: WaveIn Problem in XP



alanglloyd@xxxxxxx wrote:
This won't make much sense unless you have used waveIn functions to
record wave files.

I have a recording program which uses WaveIn???() to record dictation.
Since moving to XP a problem and executable which worked OK on Win 98
malfunctions by filling buffers too fast (by a factor of some 4.3).

I call waveInOpen with a GSM WaveFormatEx record to record 11025
samples/sec which should record at 2239{.45} bytes / sec. waveInOpen
returns with a value of 0 (meaning success). I desire to use 0.2 sec
buffers and set them to 455 bytes (block size is 65 bytes on GSM) and
allocate memory for the buffers and headers and waveInPrepare the
headers. All preparation functions return OK. I put the buffers in the
queue and call waveInStart.

When the buffer is filled with wave data it sends a MM_WIM_DATA message
to a mini-window for messages in my application with a pointer to the
waveheader holding the buffer reference. As part of the debugging to
find out where it goes wrong I display the count of bytes recorded by
wavein in the buffer (455 bytes - OK) and the time the message is
received (and I guess sent). This shows that a buffer is returned every
47 mSec. Which agrees with the increased rate of recording. It should
return a buffer every 203 mSecs.

I have another, much smaller program doing identical actions (it was a
development version of the main code) which works perfectly at the
correct speed. Careful comparison shows no difference in the code.

When I change the WaveFormatEx record (defining the sampling rate etc)
to 8000Hz instead of 11025Hz (with the same buffer) the buffers were
returned at the same rate - ie once every 47 mSecs.

The exe of this program works OK on other XP PCs, and exes from the
same code compiled on other XP PC work OK on them but fail with a fast
record on my PC.

Any suggestions of cause, or of further investigation would be welcome.

Alan Lloyd

many sound cards require you to have a minimum of 512 byte buffers.
 and thus try to keep the figure on a even boundary through out.
  also, the sound drivers are vender specific and they can pretty
much support what they want!, not all rare multimedia functions and
settings are supported...



--
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5

.