mackron / miniaudio

Audio playback and capture library written in C, in a single source file.
https://miniaud.io
Other
4.07k stars 361 forks source link

How do I get PCM data with the wasapi backend? #361

Closed ChenTianSky closed 3 years ago

ChenTianSky commented 3 years ago

How do I get PCM data with the wasapi backend?

ChenTianSky commented 3 years ago

I need PCM data for the speakers

mackron commented 3 years ago

Do you mean you want to capture the sound that comes out of the speakers? Take a look at the loopback example: https://github.com/mackron/miniaudio/blob/master/examples/simple_loopback.c

ChenTianSky commented 3 years ago

I use the code of this example. Files saved as PCM or encoded as AAC cannot be played. PCM files should be played in Adobe audit

mackron commented 3 years ago

Make sure you press Enter to quit the program so that the encoder is uninitialized properly. If you just terminate the program it won't write out some header information to the output file.