(self, data: bytes)
| 71 | return self._frame_count |
| 72 | |
| 73 | def add_data(self, data: bytes): |
| 74 | with self.lock: |
| 75 | # bytes is pcm16 single channel audio data, convert to numpy array |
| 76 | np_data = np.frombuffer(data, dtype=np.int16) |
| 77 | self.queue.append(np_data) |
| 78 | if not self.playing: |
| 79 | self.start() |
| 80 | |
| 81 | def start(self): |
| 82 | self.playing = True |
no test coverage detected