| | |
| | | # -*- encoding: utf-8 -*- |
| | | #!/usr/bin/env python3 |
| | | # Copyright FunASR (https://github.com/alibaba-damo-academy/FunASR). All Rights Reserved. |
| | | # MIT License (https://opensource.org/licenses/MIT) |
| | | |
| | | import argparse |
| | | import logging |
| | | import os |
| | |
| | | batch_size = speech.shape[0] |
| | | segments = [[]] * batch_size |
| | | if self.frontend is not None: |
| | | feats, feats_len = self.frontend.forward(speech, speech_lengths, is_final) |
| | | reset = in_cache == dict() |
| | | feats, feats_len = self.frontend.forward(speech, speech_lengths, is_final, reset) |
| | | fbanks, _ = self.frontend.get_fbank() |
| | | else: |
| | | raise Exception("Need to extract feats first, please configure frontend configuration") |