Re: Copy wavein to waveout

From: Grant Schenck (schenckg_at_optonline.net)
Date: 09/21/04

  • Next message: Chris P. [MVP]: "Re: Copy wavein to waveout"
    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.

    Thanks

    --
    Grant Schenck
    schenckg@optonline.net
    "Chris P. [MVP]" <msdn@chrisnet.net> wrote in message
    news:Os5fq5BoEHA.3564@tk2msftngp13.phx.gbl...
    > 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.
    >
    >
    

  • Next message: Chris P. [MVP]: "Re: Copy wavein to waveout"

    Relevant Pages

    • Re: Copy wavein to waveout
      ... > Regarding my initial goal of doing this with wave. ... > thread for reading a writing and I pass buffers from the reader to the ... Curious what you're using for audio hardware? ... and the Window handle message are both affected by window message processing ...
      (microsoft.public.win32.programmer.mmedia)
    • Re: How to disable Software Mixer?
      ... Apparently it's the audio ... flow from the application to the driver. ... buffers are passed 'just as' to the driver. ... Call waveOutUnprepareHeader on each header. ...
      (microsoft.public.windowsce.platbuilder)
    • Re: Copy wavein to waveout
      ... Regarding my initial goal of doing this with wave. ... thread for reading a writing and I pass buffers from the reader to the ... doing this I get crackle audio. ...
      (microsoft.public.win32.programmer.mmedia)
    • Re: waveInOpen() etc. and overrun detection...
      ... where the resultant wavfile is missing numerous random slices of audio. ... The first thing that comes to mind is: Do you have enough buffers ... When handling WaveInProc, send the used buffer back to the driver ... and then you could have an overrun situation because the message loop ...
      (microsoft.public.win32.programmer.mmedia)
    • Re: waveInOpen() etc. and overrun detection...
      ... where the resultant wavfile is missing numerous random slices of audio. ... The first thing that comes to mind is: Do you have enough buffers ... When handling WaveInProc, send the used buffer back to the driver ...
      (microsoft.public.win32.programmer.mmedia)