This is the minmal example for this question: https://stackoverflow.com/questions/75712706/how-to-record-and-encode-a-mp3-in-an-electron-app
An Electron application with React and TypeScript
I made this with yarn. The shortcut to start and stop the recoding is cmd+x.