Put the new audio in the queue. If the stream is ending, also put a stop signal in the queue.
(self, audio: np.ndarray, stream_end: bool = False)
| 131 | self.on_finalized_audio(audio_values[self.to_yield :], stream_end=True) |
| 132 | |
| 133 | def on_finalized_audio(self, audio: np.ndarray, stream_end: bool = False): |
| 134 | """Put the new audio in the queue. If the stream is ending, also put a stop signal in the queue.""" |
| 135 | self.audio_queue.put(audio, timeout=self.timeout) |
| 136 | if stream_end: |
| 137 | self.audio_queue.put(self.stop_signal, timeout=self.timeout) |
| 138 | |
| 139 | def __iter__(self): |
| 140 | return self |