(self)
Emit a sound.
Emit a sound.
Emit a sound .
def emit(self):
        """Emit a sound."""
        if not self._proc or (self.loop and self._proc.poll() is not None):
            if self._frequency == 0 or self._frequency == 32767:
                self._proc = subprocess.Popen(
                    'sleep {0}'.format(self._duration).split())
            else:
                self._proc = subprocess.Popen(
                    'beep -f {freq} -l {dur}'.format(
                        freq=self._frequency, dur=self._duration*1000,
                    ).split())
        # return self if still busy, None otherwise
        if self._proc and self._proc.poll() is None:
            return self
        else:
            return None
def emit ( self ) : if not self . _proc or ( self . loop and self . _proc . poll ( ) is not None ) : if self . _frequency == 0 or self . _frequency == 32767 : self . _proc = subprocess . Popen ( 'sleep {0}' . format ( self . _duration ) . split ( ) ) else : self . _proc = subprocess . Popen ( 'beep -f {freq} -l {dur}' . format ( freq = self . _frequency , dur = self . _duration * 1000 , ) . split ( ) ) # return self if still busy, None otherwise if self . _proc and self . _proc . poll ( ) is None : return self else : return None