Flushes any remaining cache and appends the stop symbol.
(self)
| 122 | self.to_yield += len(audio_values) - self.to_yield - self.stride |
| 123 | |
| 124 | def end(self): |
| 125 | """Flushes any remaining cache and appends the stop symbol.""" |
| 126 | if self.token_cache is not None: |
| 127 | audio_values = self.apply_delay_pattern_mask(self.token_cache) |
| 128 | else: |
| 129 | audio_values = np.zeros(self.to_yield) |
| 130 | |
| 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.""" |
nothing calls this directly
no test coverage detected