Mail Archives: djgpp/2001/11/02/07:04:13
In comp.os.msdos.djgpp jeffchan <jeffkhc AT netvigator DOT com> wrote:
> Actually, the input data is analog voice data. I need to control an
> capture card to read and store it into hard drive. Now i find that
> some strange sound like "tak" in my recorded file. It appears in each
> times i use fwrite() to put the data from buffer into a file. When i
> change the buffer size, the period of the "tak" is also changed.
That "tak" is almost certainly caused by those sound IRQ that are lost
while the fwrite() call is working. This kind of problem is what
caused the makes of Soundblaster cards to add DMA capabilities. Those
allow you to let your sound card work on its own, for a while, instead
of having to poll it or handle IRQ's at a very high frequency.
If your capturing hardware doesn't support DMA, I suspect you'll have
to avoid doing file I/O until you're done capturing to be really
certain you avoid such problems. Today's computers should be able to
handle several minutes of incoming data in RAM. 64 MB is about 10
minutes's worth of CD-quality stereo audio data, after all.
It may be possible to make do with an additional real-mode IRQ
handler, but that would raise the complexity of the whole task by
quite a bit.
> On the other hand, i create the file's name be around 23
> characters(including extension). Of course under dos will cuts it out.
> Does any method let me use long file name?
Under raw DOS, you'ld need a special TSR driver for that. The FAQ has
pointers to a few of those, IIRC. But unless you have a very pressing
need to have such long names, I'd suggest to avoid that additional
complexity to ease solving your IRQ latency problems, first. That TSR
has to wedge itself rather deeply into DOS' inner machinery, and that
quite certainly won't make your fwrite()'s any faster.
[And please don't quote a whole article body you're replying to if
you're not *referring* to any of it. Text-at-top-with-fullquote-below
is regarded terribly bad style in most of Usenet.]
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -