Please see my article
Practical Sound Recorder with Sound Activation[
^].
It is not a UWP but is in WPF, but it doesn't matter, because its audio part is tiny, clearly written in a separate file and class and can be used anywhere where you can use legacy Windows API. Actually, this part of API is very old, doesn't require any installations.
—SA