Looking for VB6 code to record from line-input

Hello,
I am looking for some VB6 code ideas / example code to record cd/stereo quality wavs from the line-input port on a sound card. Any help is greatly appreciated. Later on I would like to convert to MP3, but not inportant at this time.
Thank you

Comments

  • : Hello,
    : I am looking for some VB6 code ideas / example code to record cd/stereo quality wavs from the line-input port on a sound card. Any help is greatly appreciated. Later on I would like to convert to MP3, but not inportant at this time.
    : Thank you
    :
    Don't have any code in VB or C to show you how to do this I'm afraid, but here's what you need to do: go and look up the functions that start with waveIn in the MSDN. I imagine it'll be something like:-

    0) Set up a callback function to save a buffer of data.
    1) Call waveInOpen
    2) Make a buffer (an array of type Integer if you're recording 16-bit audio, or Byte for 8-bit).
    3) Use waveInPrepareHeader for that buffer.
    4) When the buffer has been read, unprepare it.
    5) Go back to 2.

    Though it's not really that simple, because you'll need a couple of buffers to switch between, always making sure there is one prepared buffer. Note that if you do stereo input the samples will appear in the array left, right, left, right.

    An alternative method is to use MCI, which handles the dirty work for you but doesn't give you quite so much freedom.

    Hope this helps set you off in the right direction. Also Google around - there probably will be sample code for this online somewhere.

    ###
    for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion