def METHOD_NAME(
    self, samples: torch.Tensor, is_final: bool
) -> torch.Tensor:
    """Get samples for feature computation.
    Args:
        samples: Speech data. (S)
        is_final: Whether speech corresponds to the final chunk of data.
    Returns:
        samples: New speech data. (1, decoding_samples)
    """
    if self.samples is not None:
        samples = torch.cat([self.samples, samples], dim=0)
    samples_sz = samples.size(0)
    if is_final:
        waveform_buffer = None
        if samples_sz < self.decoding_samples:
            samples = torch.nn.functional.pad(
                samples,
                (0, self.decoding_samples - samples_sz),
                mode="constant",
                value=0.0,
            )
    else:
        n_frames = (samples_sz - self.win_hop_sz) // self.hop_sz
        n_residual = (samples_sz - self.win_hop_sz) % self.hop_sz
        waveform_buffer = samples.narrow(
            0,
            samples_sz - self.win_hop_sz - n_residual,
            self.win_hop_sz + n_residual,
        )
        samples = samples.narrow(0, 0, self.win_hop_sz + n_frames * self.hop_sz)
    self.samples = waveform_buffer
    samples = samples.unsqueeze(0).to(device=self.device)
    self.samples_length.fill_(samples.size(1))
    return samples