Re: Copy wavein to waveout
From: Grant Schenck (schenckg_at_optonline.net)
Date: Tue, 21 Sep 2004 17:19:18 -0400
Audio hardware is Sound Blaster AWE 64.
Regarding the call back method, I am using events. Specifically, the
reader thread waits on the event used on waveInOpen to know to
retrieve the filled in buffer. It places the data is memory protected
by a critical section and signals an event. The writer thread is
waiting on this event (among other things) and is released to retrieve
the buffer and send it to the wave out device.
As for graphics, I've got a ATI 3D RAGE PRO AGP 2X so I at least have
an AGP card...
I tried putting an endless loop in my reader thread and sure enough,
it locked my machine up hard requiring a reboot so I'm pretty sure
I've got the thread/process running as fast as I can.
-- Grant Schenck email@example.com "Chris P. [MVP]" <firstname.lastname@example.org> wrote in message news:Os5fq5BoEHA.email@example.com... > Grant Schenck wrote: > > Thanks Chris, > > > > I figured it was an issue like that. > > > > Regarding my initial goal of doing this with wave. I did hobble > > together a quick and dirty sample and with 100 buffers per second I > > can barely detect any latency. It is quite acceptable. I have a > > thread for reading a writing and I pass buffers from the reader to the > > writer. > > Curious what you're using for audio hardware? Not many soundcards support > 10ms buffers with WaveIn/Out. But if it works for your application then > this is a good approach. > > > HOWEVER, the problem I have that if I move other windows while I'm > > doing this I get crackle audio. So, I ended up bumping the thread > > priority of both threads to time critical. No change. Sounds fine > > when nothing going on but if I move other windows I get the audio > > crackle. So then I kicked up my process priority also to time > > critical also.Still no change. It sounds like when I move some other > > window that the wave driver stops playing but that isn't what is going > > on because if I'm playing with large buffers (say one second of audio) > > then I rarely hear the crackle. Any ideas what could be causing this? > > Is this a "known" issue when using small buffer sizes? > > When using small buffers there is only one callback method that works > reliably with waveIn/Out. You have to use Events. The function callback > and the Window handle message are both affected by window message processing > delays when message floods or delays occur. Set up a processing thread that > waits on event handle created and passed to waveInOpen(). > > Secondly there was a problem with some graphics cards hogging the PCI bus > causing headaches for soundcards. This mostly went away when AGP came out. > >