(self)
Drain audio queue.
Drain audio queue.
Drain audio queue .
def _drain_queue(self):
        """Drain audio queue."""
        while True:
            try:
                signal = self._audio_queue.get(False)
            except queue.Empty:
                return
            self._audio_queue.task_done()
            if signal.event_type == signals.QUIT:
                # close thread
                self.alive = False
            elif signal.event_type == signals.AUDIO_STOP:
                self.hush()
            elif signal.event_type == signals.AUDIO_PERSIST:
                self.persist(*signal.params)
            elif signal.event_type == signals.AUDIO_TONE:
                self.tone(*signal.params)
            elif signal.event_type == signals.AUDIO_NOISE:
                self.noise(*signal.params)
def _drain_queue ( self ) : while True : try : signal = self . _audio_queue . get ( False ) except queue . Empty : return self . _audio_queue . task_done ( ) if signal . event_type == signals . QUIT : # close thread self . alive = False elif signal . event_type == signals . AUDIO_STOP : self . hush ( ) elif signal . event_type == signals . AUDIO_PERSIST : self . persist ( * signal . params ) elif signal . event_type == signals . AUDIO_TONE : self . tone ( * signal . params ) elif signal . event_type == signals . AUDIO_NOISE : self . noise ( * signal . params )