def __init__(self, audio_rate, latency): self._started = False self._audio_source = None self._pa = Simple('Kunquat Tracker', 'Editor output', rate=audio_rate, latency=latency)
class Pushaudio(): def __init__(self, audio_rate, latency): self._started = False self._audio_source = None self._pa = Simple('Kunquat Tracker', 'Editor output', rate=audio_rate, latency=latency) def set_audio_source(self, audio_source): self._audio_source = audio_source def put_audio(self, audio_data): assert self._started (left, right) = audio_data if len(left) > 0: self._pa.write(left, right) self._audio_source.acknowledge_audio() def start(self): self._started = True def stop(self): pass def close(self): self.stop() del self._pa @classmethod def get_id(cls): return 'pushaudio'
class Pushaudio(): def __init__(self, latency): self._started = False self._audio_source = None self._pa = Simple('Kunquat Tracker', 'Editor output', latency=latency) def set_audio_source(self, audio_source): self._audio_source = audio_source def put_audio(self, audio_data): assert self._started (left, right) = audio_data if len(left) > 0: self._pa.write(left, right) self._audio_source.acknowledge_audio() def start(self): self._started = True def stop(self): pass def close(self): self.stop() del self._pa @classmethod def get_id(cls): return 'pushaudio'
def __init__(self, latency): self._started = False self._audio_source = None self._pa = Simple('Kunquat Tracker', 'Editor output', latency=latency)