tools/utilities/pythonlibs/audio/microphone.py
def monitor_input(self, stream):
        """ monitor stdin since our read call is blocking, this way user can type 'x' to quit """
        try:
            while not self.closed:
                out = stream.readline()
                if out:
                    msg = out.rstrip('\n')
                    if msg == "exit" or msg == "quit" or msg == "x":                        
                        print("closing microphone...")
                        self.closed = True
                else:
                    break
        except:
            errorType, value, traceback = sys.exc_info()
            msg = "### Exception: %s: %s" % (str(errorType), str(value))
            self.print(msg)
 monitor stdin since our read call is blocking, this way user can type 'x' to quit 
monitor stdin since our read call is blocking, this way user can type 'x' to quit
monitor stdin since our read call is blocking this way user can type ' x ' to quit
def monitor_input(self, stream):
        try:
            while not self.closed:
                out = stream.readline()
                if out:
                    msg = out.rstrip('\n')
                    if msg == "exit" or msg == "quit" or msg == "x":                        
                        print("closing microphone...")
                        self.closed = True
                else:
                    break
        except:
            errorType, value, traceback = sys.exc_info()
            msg = "### Exception: %s: %s" % (str(errorType), str(value))
            self.print(msg)
def monitor_input ( self , stream ) : try : while not self . closed : out = stream . readline ( ) if out : msg = out . rstrip ( '\n' ) if msg == "exit" or msg == "quit" or msg == "x" : print ( "closing microphone..." ) self . closed = True else : break except : errorType , value , traceback = sys . exc_info ( ) msg = "### Exception: %s: %s" % ( str ( errorType ) , str ( value ) ) self . print ( msg )
monitor stdin since our read call is blocking, this way user can type 'x' to quit
monitor stdin since our read call is blocking this way user can type ' x ' to quit
""" monitor stdin since our read call is blocking, this way user can type 'x' to quit """
self
stream