In CaptureSharedEventDriven
recording time is put in TargetDurationInSec
and they set size of buffer is size_t captureBufferSize = capturer->SamplesPerSecond() * TargetDurationInSec * capturer->FrameSize()
How to record audio without TargetDurationInSec
instead I press the key combination when finished. Thanks for help.
Asked
Active
Viewed 147 times
1

Simon Mourier
- 132,049
- 21
- 248
- 298
-
1The sample needs some amount of changes. Instead of copying to a fixed sized buffer (CopyMemory in CWASAPICapture::DoCaptureThread()), write the data to a sink, as demonstrated in the sample code here: https://learn.microsoft.com/en-us/windows/win32/coreaudio/capturing-a-stream the MyAudioSink can well write to a file – Simon Mourier Nov 15 '20 at 09:10
-
Hello @SimonMourier Can you help me code? I don't understand this well. Thanks you. – Nov 16 '20 at 13:07