Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to capture PCM data from Wave Out

How would it be possible to capture the audio programmatically? I am implementing an application that streams in real time the desktop on the network. The video part is finished. I need to implement the audio part. I need a way to get PCM data from the sound card to feed to my encoder (implemented using Windows Media Format).

I think the answer is related to the openMixer(), waveInOpen() functions in Win32 API, but I am not sure exactly what should I do.

How to open the necessary channel and how to read PCM data from it?

Thanks in advance.

like image 700
Terminus Avatar asked Dec 22 '22 14:12

Terminus


1 Answers

The new Windows Vista Core Audio APIs have support for this explicitly (called Loopback Recording), so if you can live with a Vista only application this is the way to go.

See the Loopback Recording article on MSDN for instructions on how to do this.

like image 174
Nick Haddad Avatar answered Dec 28 '22 06:12

Nick Haddad