How to record audio using microphone

I need some real time transcription using whisper and I am running it in Jupyter Notebook. the problem is, I cannot access the microphone due to some missing libraries like PortAudio. The other approaches like SSH connection and Websocket is not working for me as they are missing some of the words while sending an audio chunk (5 seconds). I need real time transcription. I can do it on my system locally but I want to do it on the server. Thank you