Results 1 to 4 of 4

Thread: runs, then stops (VB.NET 2003) [resolved]

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2005
    Posts
    530

    Question runs, then stops (VB.NET 2003) [resolved]

    Hello,
    I was wondering if someone out there could run this code and see if it acts screwy on their machine. On mine, it runs for a very short time, then stops... that is, it keeps running, but stops functioning. This program is a simple VU meter that monitors the sound level from the sound card, so to make it work, you will need to play something and make sure your recording setting on your mixer is set to the appropriate device.

    The trouble I'm having is in the clsInputToBuffer2 class, in the waveInProc sub. I have some diagnostic code set up here. First, I just fed in buffers, then read them out assuming they were coming out in the order they were going in. That didn't work, and not knowing how the sound card driver would handle it, I decided to poll the buffers to read back only those that were full. You can see that the code displays in a text box the index of the buffer it reads. On my machine, it reads for a while, then stops, thus entering the second part of the waveInProc sub where it trys to see how many bytes were read. It seems that, for every buffer, it sends back MM_WIM_DATA but the buffer is empty. The sub is called once for each empty buffer, then waveInProc stops being called at all. Funny thing, if you enable the GC.COLLECT line, it runs a bit longer.
    Thanks.
    Last edited by rickford66; Jan 29th, 2007 at 12:08 PM.

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    May 2005
    Posts
    530

    Re: runs, then stops (VB.NET 2003)

    By the way, this was also designed to work on a timer, as I had limping along using a timer before. There is a small amount of code for that, such as readbufferA and such. Just ignore that.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    May 2005
    Posts
    530

    Re: runs, then stops (VB.NET 2003)

    One more thing, to make the meters responsive, you will have to change the size of the buffers to something like 128 (in clsInputToBuffer2 class). There is a real possibility (I have reason to believe) that this is just a problem with the sound card/driver, so if anyone could try to run this, that would be great.
    Last edited by rickford66; Jan 27th, 2007 at 09:35 PM.

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    May 2005
    Posts
    530

    Re: runs, then stops (VB.NET 2003)

    Nevermind. I got it working.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width