Recording Microphone to wav file

I’m looking for some simple code to write sound from the microphone to a wav file.

I’d like a method to start recording on clicking a start button.
And another method to stop recording and write the recording to disk on clicking a stop button.

Does anyone have any simple c# code already to do this?
I’ve found some java but I cant get it working on trying to convert it.

Thanks in advance

I appear to have managed to butcher the following and make it work.

Thanks

1 Like

Hi newcoder17, this exactly what I’m looking for as well! Would you maybe be able to share your script/code? That would be awesome because I’ve tried to make it work with the code in the link but wasn’t successful. All the best