def METHOD_NAME(tensor, tgt_dur, sample_rate=16000):
    seg_len = int(tgt_dur * sample_rate)
    src_len = len(tensor)
    hop_len = seg_len // 4
    tgt_len = seg_len if src_len <= seg_len else (src_len // hop_len + 1) * hop_len
    pad_len = tgt_len - src_len
    front_pad_len = random.randint(0, pad_len)
    tail_pad_len = pad_len - front_pad_len
    padded_tensor = torch.cat(
        [torch.zeros(front_pad_len), tensor, torch.zeros(tail_pad_len)]
    )
    segments = padded_tensor.unfold(0, seg_len, hop_len).unbind(0)
    return segments