Hope that helps I am pretty sure that this is NOT what you want to do. Just collect and discard the samples when ptt is not activated. There are a variety of reasons for doing it this way, the biggest of which is that you will be mich more responsive (you can start sending samples as soon as you receive the button press event, otherwise, you have to wait for all the hardware changes to take effect.
hop of those help? not sure if you are familiar with Dealing with micrphone in WP7 or not but you can check this blog post for a full detailed tutorial : you initialize a buffer with the size of the data :
microphone in windows 10 in virtualbox
By : shanu badala
Date : March 29 2020, 07:55 AM
help you fix your problem In VirtualBox open the settings for your Windows 10 machine Go to Audio > Audio Controller, change to "ICH AC97" Boot your Windows 10 machine and disable driver signature enforcement Go to Realtek's website, download and install the AC'97 audio codec/driver for Vista/7 ("Vista/Win7 (32/64 bits) Driver only (ZIP file)") onto your Windows 10 machine (run setup.exe after unzipping) Reboot Windows 10 and you should be done