If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Capture sounds from soundcard=speakers - NOT from microphone

What I would like to do is to capture the sounds you hear from the computer speakers - NOT from the microphone. I.E if you listen to song in youtube with the computer then to capture that song sound. I.E everything that is playing or should be playing on the speakers should be recorded. I found that best will be to use the waveIn* functions, such as

waveInOpen
waveInPrepareHeader
waveInAddBuffer // in loop for all buffers
waveInStart
waveInStop
waveInReset
waveInUnprepareHeader // in loop for all buffers
waveInClose

(this wave* is new to me so sorry for any dumb question)

My problems are:

I think that waveInOpen records what you speak on the mic and not the speakers so i am not sure how to tell it to capture the speakers/soundcard.
I am note sure i understand how to make the software to still be active while the recording is running I.E where to put the Wait().
I do not understand how to create sound file .pcm from the buffers. I.e should i append buf(1) + buf(2) + buf(3) + ... (the buf i sent to waveInAddBuffer) for creating the file?
And I do not understand how to connect everything - i.e., I do NOT want to record X minutes, then to stop and then save to file. I need to transmit this recording online in real time so i need immediate access to the data.

The final goal is to transmit the recording after it is encoded - to another device in real time - currently i am not asking about the encoder since i will deal with it latter.

So GetCurrentSounds fill arr with the recording that took place (in another thread i guess) from the time GetCurrentSounds last called .

Yes, I do not really need to save to file - but the reason i asked how to save it to file is for debugging to see that I do everything ok. Hope you can provide explanation to the 3 question and even some code how to do what I need.

Please note the Stereo Mix is disabled by default. Maybe you can programmatically enable it, but I have no idea how.

Thanks but this is not the solution:
From the article:
In other instances, however, itís because the newest Windows 7 drivers donít support this feature. This was the case on my Asus Eee PC (a 1000HE), but I got around the issue by downloading and installing the older Windows XP/Vista drivers for my audio chipset
--------------------------------