Search code examples
pythonsshjupyter-notebookspeech-recognitionpyaudio

How to access input device of local machine in Jupyter notebook running on remote server through ssh?


Say I want to input with the microphone of my local machine and pass it to the code in the jupyter notebook running on a remote server through ssh.

import speech_recognition as sr
recog = sr.Recognizer()
with sr.Microphone() as source:
    print("Start recording...")
    audio = recog.listen(source)

This snippet reads audio input from the microphone of my local machine when I run it on a local jupyter notebook. Is it possible to pipe the audio input from my local machine to the jupyter notebook running on a remote server through ssh?


Solution

  • Here are my two cents on it (in two points - pun intended):

    • You can save it into some database and read it remotely.
    • If you insist on the ssh route, you have your work cut out for you.... I would start from here.