Forward. Args: input (ComplexTensor): spectrum [Batch, 1, F] output: wavs [Batch, 1, self.win_length]
(self, input_frame: torch.Tensor)
| 136 | return spec |
| 137 | |
| 138 | def forward_streaming(self, input_frame: torch.Tensor): |
| 139 | """Forward. |
| 140 | |
| 141 | Args: |
| 142 | input (ComplexTensor): spectrum [Batch, 1, F] |
| 143 | output: wavs [Batch, 1, self.win_length] |
| 144 | """ |
| 145 | input_frame = self.spec_back(input_frame) |
| 146 | input_frame = input_frame.real + 1j * input_frame.imag |
| 147 | output_wav = ( |
| 148 | torch.fft.irfft(input_frame) |
| 149 | if self.stft.onesided |
| 150 | else torch.fft.ifft(input_frame).real |
| 151 | ) |
| 152 | |
| 153 | output_wav = output_wav.squeeze(1) |
| 154 | |
| 155 | n_pad_left = (self.n_fft - self.win_length) // 2 |
| 156 | output_wav = output_wav[..., n_pad_left : n_pad_left + self.win_length] |
| 157 | |
| 158 | return output_wav * self._get_window_func() |
| 159 | |
| 160 | def streaming_merge(self, chunks, ilens=None): |
| 161 | """streaming_merge. It merges the frame-level processed audio chunks |