def _get_write_index(self): timing_info = pa.pa_stream_get_timing_info(self.stream) if timing_info: write_index = timing_info.contents.write_index else: write_index = 0 if _debug: print '_get_write_index ->', write_index return write_index
def _get_read_index(self): # time = pa.pa_usec_t() context.lock() context.sync_operation(pa.pa_stream_update_timing_info(self.stream, self._success_cb_func, None)) context.unlock() timing_info = pa.pa_stream_get_timing_info(self.stream) if timing_info: read_index = timing_info.contents.read_index else: read_index = 0 if _debug: print "_get_read_index ->", read_index return read_index
def _process_events(self): if not self._events: return timing_info = pa.pa_stream_get_timing_info(self.stream) if not timing_info: if _debug: print 'abort _process_events' return read_index = timing_info.contents.read_index while self._events and self._events[0][0] < read_index: _, event = self._events.pop(0) if _debug: print 'dispatch event', event event._sync_dispatch_to_player(self.player)
def _get_read_index(self): #time = pa.pa_usec_t() with context.lock: context.sync_operation( pa.pa_stream_update_timing_info(self.stream, self._success_cb_func, None)) timing_info = pa.pa_stream_get_timing_info(self.stream) if timing_info: read_index = timing_info.contents.read_index else: read_index = 0 if _debug: print '_get_read_index ->', read_index return read_index