(self)
Synchronise the three tone voices.
Synchronise the three tone voices.
Synchronise the three tone voices .
def emit_synch(self):
        """Synchronise the three tone voices."""
        # on Tandy/PCjr, align voices (excluding noise) at the end of each PLAY statement
        if self._multivoice:
            max_time = max(q.expiry() for q in self._voice_queue[:3])
            for voice, q in enumerate(self._voice_queue[:3]):
                duration = (max_time - q.expiry()).total_seconds()
                # fill up the queue with the necessary amount of silence
                # this takes up one spot in the buffer and thus affects timings
                # which is intentional
                balloon = signals.Event(signals.AUDIO_TONE, (voice, 0, duration, False, 0))
                self._queues.audio.put(balloon)
                self._voice_queue[voice].put(balloon, duration, None)
        self._synch = False
def emit_synch ( self ) : # on Tandy/PCjr, align voices (excluding noise) at the end of each PLAY statement if self . _multivoice : max_time = max ( q . expiry ( ) for q in self . _voice_queue [ : 3 ] ) for voice , q in enumerate ( self . _voice_queue [ : 3 ] ) : duration = ( max_time - q . expiry ( ) ) . total_seconds ( ) # fill up the queue with the necessary amount of silence # this takes up one spot in the buffer and thus affects timings # which is intentional balloon = signals . Event ( signals . AUDIO_TONE , ( voice , 0 , duration , False , 0 ) ) self . _queues . audio . put ( balloon ) self . _voice_queue [ voice ] . put ( balloon , duration , None ) self . _synch = False