def audio_to_tensor_resample(
        audio: Union[torch.Tensor, np.ndarray, str, bytes],
        original_sample_rate: Optional[int] = None,
        target_sample_rates: Optional[Union[int, Iterable[int]]] = None,
        **kwargs
) -> torch.Tensor:
    """
    Return ``audio`` as Tensor and resample as needed.
    """
    if target_sample_rates and isinstance(target_sample_rates, int):
        target_sample_rates = [target_sample_rates]

    if isinstance(audio, (str, bytes)):
        if target_sample_rates:
            original_sample_rate = target_sample_rates[0]
        audio = load_audio(audio, sr=original_sample_rate,**kwargs)
    elif not original_sample_rate:
        original_sample_rate = SAMPLE_RATE
    if isinstance(audio, np.ndarray):
        audio = torch.from_numpy(audio)
    audio = audio.float()

    if target_sample_rates and original_sample_rate not in target_sample_rates:
        audio = resample(audio, original_sample_rate, target_sample_rates[0])

    return audio

    Return ``audio`` as Tensor and resample as needed.
    
stable_whisper/audio/utils.py