BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

WaveIn Problem in XP

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc
View previous topic :: View next topic  
Author Message
alanglloyd@aol.com
Guest





PostPosted: Tue Sep 27, 2005 6:57 pm    Post subject: WaveIn Problem in XP Reply with quote



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

Back to top
Jamie
Guest





PostPosted: Wed Sep 28, 2005 3:01 am    Post subject: Re: WaveIn Problem in XP Reply with quote



[email]alanglloyd (AT) aol (DOT) com[/email] wrote:
Quote:
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


Back to top
alanglloyd@aol.com
Guest





PostPosted: Wed Sep 28, 2005 6:20 am    Post subject: Re: WaveIn Problem in XP Reply with quote



Doubling the buffer size to 0.4 secs (== 910 bytes) made no difference
to the speed multiple - it returned the buffer every 94mS instead of
every 406mS. The buffer must be on a block align multiple (65 bytes for
GSM) any way.

If "buffer size too small" were a factor, why didn't the
waveInPrepareHeader() function fail.

MS GSM 6.10 is a bog-standard compression format, the appropriate codec
is installed, and has formats for the sample rates I request.
waveOut???() functions (playback) work fine at these settings of
format, sample rates and buffer sizes.

Thanks for replying though.

Alan Lloyd

Back to top
alanglloyd@aol.com
Guest





PostPosted: Fri Sep 30, 2005 6:16 am    Post subject: Re: WaveIn Problem in XP Reply with quote

It was resolved when I installed a sound card in place of the
motherboard sound support. I don't know whether the sound card install
corrected an error in the registry, or installed a different DLL, or
whether the motherboard sound support was bad.

Alan Lloyd

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.