class_docstr: STFT encoder for speech enhancement and separation
docstr: streaming_frame. It splits the continuous audio into frame-level
  audio chunks in the streaming *simulation*. It is noted that this
  function takes the entire long audio as input for a streaming simulation.
  You may refer to this function to manage your streaming input
  buffer in a real streaming application.
  
  Args:
      audio: (B, T)
  Returns:
      chunked: List [(B, frame_size),]
docstr_tok: ["streaming_frame",".","It","splits","the","continuous","audio","into","frame-level","audio","chunks","in","the","streaming","*","simulation","*",".","It","is","noted","that","this","function","takes","the","entire","long","audio","as","input","for","a","streaming","simulation",".","You","may","refer","to","this","function","to","manage","your","streaming","input","buffer","in","a","real","streaming","application",".","Args",":","audio",":","(","B",",","T",")","Returns",":","chunked",":","List","[","(","B",",","frame_size",")",",","]"]
code: def streaming_frame(self, audio):
      """streaming_frame. It splits the continuous audio into frame-level
      audio chunks in the streaming *simulation*. It is noted that this
      function takes the entire long audio as input for a streaming simulation.
      You may refer to this function to manage your streaming input
      buffer in a real streaming application.
  
      Args:
          audio: (B, T)
      Returns:
          chunked: List [(B, frame_size),]
      """  # noqa: H405
  
      if self.center:
          pad_len = int(self.win_length // 2)
          signal_dim = audio.dim()
          extended_shape = [1] * (3 - signal_dim) + list(audio.size())
          # the default STFT pad mode is "reflect",
          # which is not configurable in STFT encoder,
          # so, here we just use "reflect mode"
          audio = torch.nn.functional.pad(
              audio.view(extended_shape), [pad_len, pad_len], "reflect"
          )
          audio = audio.view(audio.shape[-signal_dim:])
  
      _, audio_len = audio.shape
  
      n_frames = 1 + (audio_len - self.win_length) // self.hop_length
      strides = list(audio.stride())
  
      shape = list(audio.shape[:-1]) + [self.win_length, n_frames]
      strides = strides + [self.hop_length]
  
      return audio.as_strided(shape, strides, storage_offset=0).unbind(
          dim=-1
      )
  
file_path: espnet/espnet2/enh/encoder/stft_encoder.py
imports: import torch
  from packaging.version import parse
  from torch_complex.tensor import ComplexTensor
  from espnet2.enh.encoder.abs_encoder import AbsEncoder
  from espnet2.layers.stft import Stft
label_desc: Use image node_id 9 for calling the STFTEncoder obj's underlying member method code with example usage: obj.streaming_frame(audio) and returns: audio